]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
xen: try harder to locate xen-detect
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Fri, 5 Mar 2010 10:51:56 +0000 (11:51 +0100)
committerPhilippe Seewer <philippe.seewer@bfh.ch>
Fri, 5 Mar 2010 10:51:56 +0000 (11:51 +0100)
On debian systems xen-detect does not resite somewhere in $PATH,
but under /usr/lib/xen-default/bin. This patch ensures that this
is searched as well when locating and installing xen-detect.

modules.d/60xen/check
modules.d/60xen/install

index fbad0128455126497f296606473f03b5f692f1e7..420cdc2bac0b20f7ba5c1aa686b1d04fe871f322 100755 (executable)
@@ -1,12 +1,14 @@
 #!/bin/bash
 
 # No Xen-detect? Boo!!
-which xen-detect >/dev/null 2>&1 || exit 1
+XENDETECT=$(which xen-detect)
+[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
+[ -z "$XENDETECT" ] && exit 1
 
 . $dracutfunctions
 [[ $debug ]] && set -x
 
 # Yes, we are under Xen PV env.
-xen-detect | egrep -q -v 'PV' || exit 0
+$XENDETECT | egrep -q -v 'PV' || exit 0
 
 exit 1
index 71a508fc713cf0a0f6752dff7a028c2cff4a06c1..89065b5d5c1ea8573c19986d62cb7c4000841826 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/bash
-inst xen-detect 
+XENDETECT=$(which xen-detect)
+[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
+inst $XENDETECT /sbin/xen-detect
 inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"