Fix the detection of udev with udev version > 123 Signed-off-by: Marc-A. Dahlhaus diff -Nurp xen-3.3.1.orig/install.sh xen-3.3.1/install.sh --- xen-3.3.1.orig/install.sh +++ xen-3.3.1/install.sh @@ -30,6 +30,9 @@ echo "Installing Xen from '$src' to '$ds [ -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 info -V | awk '{print $NF}') + if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then echo " - installing for udev-based system" rm -rf "$tmp/etc/hotplug" diff -Nurp xen-3.3.1.orig/tools/check/check_udev xen-3.3.1/tools/check/check_udev --- xen-3.3.1.orig/tools/check/check_udev +++ xen-3.3.1/tools/check/check_udev @@ -8,8 +8,11 @@ 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 info -V | awk '{print $NF}'` + [ -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 -Nurp xen-3.3.1.orig/tools/examples/Makefile xen-3.3.1/tools/examples/Makefile --- xen-3.3.1.orig/tools/examples/Makefile +++ xen-3.3.1/tools/examples/Makefile @@ -44,6 +44,14 @@ XEN_SCRIPT_DATA += vtpm-migration.sh vtp XEN_HOTPLUG_DIR = /etc/hotplug XEN_HOTPLUG_SCRIPTS = xen-backend.agent +UDEVVER = 0 +ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1) +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 = /etc/udev UDEV_RULES = xen-backend.rules @@ -52,7 +60,7 @@ DE = $(if $(DESTDIR),$(shell readlink -f 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 [ $(UDEVVER) -ge 059 ] && echo 1),1) HOTPLUGS=install-udev else HOTPLUGS=install-hotplug