aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-06-25 13:02:37 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-06-25 13:02:37 +0100
commit6cba5a2ed1a602ed4b6576709f9dad9fae105111 (patch)
treeec8714ed18034f0863fa5fb6df612371d546508a
parenta8ccb671c3777e3bb6416a1624b6aa9d7185dd1c (diff)
downloadxen-6cba5a2ed1a602ed4b6576709f9dad9fae105111.tar.gz
xen-6cba5a2ed1a602ed4b6576709f9dad9fae105111.tar.bz2
xen-6cba5a2ed1a602ed4b6576709f9dad9fae105111.zip
Fix buildsystem to detect udev > version 124
udev removed the udevinfo symlink from versions higher than 123 and xen's build-system could not detect if udev is in place and has the required version. Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
-rwxr-xr-xinstall.sh2
-rwxr-xr-xtools/check/check_udev6
-rw-r--r--tools/hotplug/Linux/Makefile8
3 files changed, 13 insertions, 3 deletions
diff --git a/install.sh b/install.sh
index fab9472c86..77d24087f2 100755
--- a/install.sh
+++ b/install.sh
@@ -30,6 +30,8 @@ echo "Installing Xen from '$src' to '$dst'..."
[ -x "$(which udevinfo)" ] && \
UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
+[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && UDEV_VERSION=$(/sbin/udevadm -V)
+
if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
echo " - installing for udev-based system"
rm -rf "$tmp/etc/hotplug"
diff --git a/tools/check/check_udev b/tools/check/check_udev
index 3deaa36ccb..7d4360d0b4 100755
--- a/tools/check/check_udev
+++ b/tools/check/check_udev
@@ -8,8 +8,10 @@ OpenBSD|NetBSD|FreeBSD)
has_or_fail vnconfig
;;
Linux)
- has_or_fail udevinfo
- [ "`udevinfo -V | awk '{print $NF}'`" -ge 59 ] 2>/dev/null || \
+ has /sbin/udevadm && udevver=`/sbin/udevadm -V`
+ [ -z "$udevver" ] && has_or_fail udevinfo && \
+ udevver=`udevinfo -V | awk '{print $NF}'`
+ [ "$udevver" -ge 59 ] 2>/dev/null || \
has hotplug || \
fail "udev is too old, upgrade to version 59 or later"
;;
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 5c83fe4526..8c7fe5d033 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -24,6 +24,12 @@ XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
XEN_HOTPLUG_SCRIPTS = xen-backend.agent
+ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
+UDEVINFO = /sbin/udevadm
+else
+UDEVINFO = /usr/bin/udevinfo
+endif
+
UDEV_RULES_DIR = $(CONFIG_DIR)/udev
UDEV_RULES = xen-backend.rules xend.rules
@@ -32,7 +38,7 @@ DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
ifeq ($(findstring $(DI),$(DE)),$(DI))
HOTPLUGS=install-hotplug install-udev
else
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && [ `/usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
+ifeq ($(shell [ -x $(UDEVINFO) -a `$(UDEVINFO) -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
HOTPLUGS=install-udev
else
HOTPLUGS=install-hotplug