--- modules.d/60xen/check | 9 +++++---- modules.d/60xen/install | 7 +++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules.d/60xen/check b/modules.d/60xen/check index 49d5435..6b9cabe 100755 --- a/modules.d/60xen/check +++ b/modules.d/60xen/check @@ -1,14 +1,15 @@ #!/bin/bash # No Xen-detect? Boo!! -XENDETECT=$(type -P xen-detect) -[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect" -[ -z "$XENDETECT" ] && exit 1 +if ! hash xen-detect 2>/dev/null; then + [[ -d /usr/lib/xen-default ]] && \ + hash -p /usr/lib/xen-default/bin/xen-detect xen-detect || exit 1 +fi . $dracutfunctions [[ $debug ]] && set -x # Yes, we are under Xen PV env. -$XENDETECT | egrep -q -v 'PV' || exit 0 +xen-detect | grep -q -v PV || exit 0 exit 1 diff --git a/modules.d/60xen/install b/modules.d/60xen/install index 22f5329..6ae0060 100755 --- a/modules.d/60xen/install +++ b/modules.d/60xen/install @@ -1,6 +1,5 @@ #!/bin/bash -XENDETECT=$(type -P xen-detect) -[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect" -inst $XENDETECT /sbin/xen-detect +hash xen-detect 2>/dev/null || \ + hash -p /usr/lib/xen-default/bin/xen-detect xen-detect +inst "$(hash -t xen-detect)" /sbin/xen-detect inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh" - -- 1.7.2
Attachment:
signature.asc
Description: PGP signature