ia64/xen-unstable

changeset 7264:409cea2432fc

Add installation of the udev rules if appropriate. With a normal 'make
install', the udev rules will be installed if udev version is >= 059;
otherwise, the hotplug rules get installed.

When 'make dist' is done, we set a variable so that both hotplug and
udev rules are installed into the dist tarball. install.sh then takes
care of picking the proper rules.

Also changes the hotplug check to look for a proper udev version

Signed-off-by: Jeremy Katz <katzj@redhat.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Oct 07 14:47:45 2005 +0100 (2005-10-07)
parents e9e10e783ccd
children 4b9c9b85b3a5
files install.sh tools/check/check_hotplug tools/examples/Makefile
line diff
     1.1 --- a/install.sh	Fri Oct 07 13:34:45 2005 +0100
     1.2 +++ b/install.sh	Fri Oct 07 14:47:45 2005 +0100
     1.3 @@ -23,10 +23,16 @@ if ! [ -d $dst ]; then
     1.4  fi
     1.5  
     1.6  echo "Installing Xen from '$src' to '$dst'..."
     1.7 -(cd $src; tar -cf - --exclude etc/init.d * ) | tar -C $dst -xf -
     1.8 +(cd $src; tar -cf - --exclude etc/init.d --exclude etc/hotplug --exclude etc/udev * ) | tar -C $dst -xf -
     1.9  cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
    1.10  echo "All done."
    1.11  
    1.12 +if [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
    1.13 +  cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
    1.14 +else
    1.15 +  cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
    1.16 +fi
    1.17 +
    1.18  echo "Checking to see whether prerequisite tools are installed..."
    1.19  cd $src/../check
    1.20  ./chk install
     2.1 --- a/tools/check/check_hotplug	Fri Oct 07 13:34:45 2005 +0100
     2.2 +++ b/tools/check/check_hotplug	Fri Oct 07 14:47:45 2005 +0100
     2.3 @@ -7,4 +7,8 @@ function error {
     2.4     exit 1
     2.5  }
     2.6  
     2.7 +if [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `udev -V` -ge 059 ]; then
     2.8 +  exit 0
     2.9 +fi
    2.10 +
    2.11  which hotplug 1>/dev/null 2>&1 || error
     3.1 --- a/tools/examples/Makefile	Fri Oct 07 13:34:45 2005 +0100
     3.2 +++ b/tools/examples/Makefile	Fri Oct 07 14:47:45 2005 +0100
     3.3 @@ -28,10 +28,23 @@ XEN_SCRIPTS += block-enbd
     3.4  XEN_HOTPLUG_DIR = /etc/hotplug
     3.5  XEN_HOTPLUG_SCRIPTS = xen-backend.agent
     3.6  
     3.7 +UDEV_RULES_DIR = /etc/udev/rules.d
     3.8 +UDEV_RULES = xen-backend.rules
     3.9 +
    3.10 +ifeq ($(findstring $(DISTDIR),$(DESTDIR)),$(DISTDIR))
    3.11 +HOTPLUGS=install-hotplug install-udev
    3.12 +else
    3.13 +ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
    3.14 +HOTPLUGS=install-udev
    3.15 +else
    3.16 +HOTPLUGS=install-hotplug
    3.17 +endif
    3.18 +endif
    3.19 +
    3.20  all:
    3.21  build:
    3.22  
    3.23 -install: all install-initd install-configs install-scripts install-hotplug
    3.24 +install: all install-initd install-configs install-scripts $(HOTPLUGS)
    3.25  
    3.26  install-initd:
    3.27  	[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
    3.28 @@ -64,4 +77,12 @@ install-hotplug:
    3.29  	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
    3.30  	done
    3.31  
    3.32 +install-udev:
    3.33 +	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
    3.34 +		$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)
    3.35 +	for i in $(UDEV_RULES); \
    3.36 +	    do \
    3.37 +	    $(INSTALL_PROG) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
    3.38 +	done
    3.39 +
    3.40  clean: