aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-07-02 11:31:00 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-07-02 11:31:00 +0100
commit773e0fb2ff4ea593c68d75f7e87560e4ff727ccb (patch)
tree3d93e82865deb4d04f9f42a4481db454bb6ecd75
parent89c6cf58e8adffa03ae33da6af2a5590a5d03054 (diff)
downloadxen-773e0fb2ff4ea593c68d75f7e87560e4ff727ccb.tar.gz
xen-773e0fb2ff4ea593c68d75f7e87560e4ff727ccb.tar.bz2
xen-773e0fb2ff4ea593c68d75f7e87560e4ff727ccb.zip
buikd: Fix the detection of udev with udevadm version < 128
Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
-rwxr-xr-xinstall.sh3
-rwxr-xr-xtools/check/check_udev3
-rw-r--r--tools/hotplug/Linux/Makefile10
3 files changed, 10 insertions, 6 deletions
diff --git a/install.sh b/install.sh
index 77d24087f2..691214e638 100755
--- a/install.sh
+++ b/install.sh
@@ -30,7 +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)
+[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
+ UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
echo " - installing for udev-based system"
diff --git a/tools/check/check_udev b/tools/check/check_udev
index 7d4360d0b4..27e557d2c2 100755
--- a/tools/check/check_udev
+++ b/tools/check/check_udev
@@ -8,7 +8,8 @@ OpenBSD|NetBSD|FreeBSD)
has_or_fail vnconfig
;;
Linux)
- has /sbin/udevadm && udevver=`/sbin/udevadm -V`
+ has /sbin/udevadm && \
+ udevver=`/sbin/udevadm info -V | awk '{print $NF}'`
[ -z "$udevver" ] && has_or_fail udevinfo && \
udevver=`udevinfo -V | awk '{print $NF}'`
[ "$udevver" -ge 59 ] 2>/dev/null || \
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 8c7fe5d033..0fb56aa79a 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -24,10 +24,12 @@ XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
XEN_HOTPLUG_SCRIPTS = xen-backend.agent
+UDEVVER = 0
ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
-UDEVINFO = /sbin/udevadm
-else
-UDEVINFO = /usr/bin/udevinfo
+UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
+endif
+ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
+UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
endif
UDEV_RULES_DIR = $(CONFIG_DIR)/udev
@@ -38,7 +40,7 @@ DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
ifeq ($(findstring $(DI),$(DE)),$(DI))
HOTPLUGS=install-hotplug install-udev
else
-ifeq ($(shell [ -x $(UDEVINFO) -a `$(UDEVINFO) -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
+ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
HOTPLUGS=install-udev
else
HOTPLUGS=install-hotplug