unchanged: --- a/Makefile Thu Oct 6 03:31:41 2005 +++ b/Makefile Thu Oct 6 04:36:33 2005 @@ -36,16 +36,25 @@ $(MAKE) -C tools build $(MAKE) -C docs build -# build and install everything into local dist directory -dist: DESTDIR=$(DISTDIR)/install -dist: dist-xen dist-kernels dist-tools dist-docs +# build and install everything into local dist directory. +dist: + @make XEN_BUILD_DIST=1 realdist +dist-%: + @make XEN_BUILD_DIST=1 realdist-`echo -n $@ | sed -e 's/dist-//'` + +# these are the real targets, but we need to set a variable so that +# everything will be installed to the distdir (making the tarball complete +# for any distribution) +realdist: DESTDIR=$(DISTDIR)/install +realdist: dist-xen dist-kernels dist-tools dist-docs $(INSTALL_DIR) $(DISTDIR)/check $(INSTALL_DATA) ./COPYING $(DISTDIR) $(INSTALL_DATA) ./README $(DISTDIR) $(INSTALL_PROG) ./install.sh $(DISTDIR) $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DISTDIR)/check -dist-%: DESTDIR=$(DISTDIR)/install -dist-%: install-% +realdist-%: DESTDIR=$(DISTDIR)/install +realdist-%: install-% + export XEN_BUILD_DIST=1 @: # do nothing # Legacy dist targets diff -u b/install.sh b/install.sh --- b/install.sh Thu Oct 6 04:36:33 2005 +++ b/install.sh Thu Oct 6 15:23:14 2005 @@ -24,8 +24,14 @@ echo "Installing Xen from '$src' to '$dst'..." -(cd $src; tar -cf - --exclude etc/init.d * ) | tar -C $dst -xf - +(cd $src; tar -cf - --exclude etc/init.d --exclude etc/hotplug --exclude etc/udev * ) | tar -C $dst -xf - cp -fdRL $src/etc/init.d/* $dst/etc/init.d/ echo "All done." +if [ -x /sbin/udev ] && [ `/sbin/udev -V` -ge 059 ]; then + cp -f $src/etc/udev/rules.d/xen-backend.rules $dst/etc/udev/rules.d/xen-backend.rules +else + cp -f $src/etc/hotplug/xen-backend.agent $dst/etc/hotplug/xen-backend.agent +fi + echo "Checking to see whether prerequisite tools are installed..." cd $src/../check unchanged: --- a/tools/check/check_hotplug Thu Oct 6 03:31:41 2005 +++ b/tools/check/check_hotplug Thu Oct 6 04:36:33 2005 @@ -7,4 +7,7 @@ exit 1 } +if [ -x /sbin/udev ] && [ `udev -V` -ge 059 ]; then + exit 0 +fi which hotplug 1>/dev/null 2>&1 || error diff -u b/tools/examples/Makefile b/tools/examples/Makefile --- b/tools/examples/Makefile Thu Oct 6 04:36:33 2005 +++ b/tools/examples/Makefile Thu Oct 6 15:23:14 2005 @@ -28,10 +28,23 @@ XEN_HOTPLUG_DIR = /etc/hotplug XEN_HOTPLUG_SCRIPTS = xen-backend.agent +UDEV_RULES_DIR = /etc/udev/rules.d +UDEV_RULES = xen-backend.rules + +ifeq (1, $(XEN_BUILD_DIST)) +HOTPLUGS=install-hotplug install-udev +else +ifeq (1,$(shell if [ -x /sbin/udev ] && [ `/sbin/udev -V` -ge 059 ]; then echo 1; fi)) +HOTPLUGS=install-udev +else +HOTPLUGS=install-hotplug +endif +endif + all: build: -install: all install-initd install-configs install-scripts install-hotplug +install: all install-initd install-configs install-scripts $(HOTPLUGS) install-initd: [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d @@ -66,2 +79,11 @@ +install-udev: + [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \ + $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR) + for i in $(UDEV_RULES); \ + do \ + $(INSTALL_PROG) $$i $(DESTDIR)$(UDEV_RULES_DIR); \ + done + + clean: