From: Warren Togami Date: Thu, 21 May 2009 23:14:50 +0000 (-0400) Subject: Abort if switch_root does not exist. X-Git-Tag: 0.1~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ee170746fe2448e1c4afbafe0c9f0261eb082d9;p=thirdparty%2Fdracut.git Abort if switch_root does not exist. Otherwise it would succeed silently when we KNOW it would fail, which is not cool. Usually this means you didn't build switch_root in your dracut checkout and you used dracut -l. (This currently cannot be done in a check script, because of the current design of check. Andreas intends on discussing a redesign on the list.) --- diff --git a/modules.d/99base/install b/modules.d/99base/install index c0ce2339f..00436ae77 100755 --- a/modules.d/99base/install +++ b/modules.d/99base/install @@ -3,5 +3,10 @@ dracut_install mount mknod mkdir modprobe pidof sleep chroot echo sed bash ls fl [ -e "${initdir}/bin/sh" ] || (ln -s bash "${initdir}/bin/sh" || :) # install our scripts and hooks inst "$moddir/init" "/init" +# Bail out if switch_root does not exist +if [ ! -x "$moddir/switch_root" ]; then + derror "ERROR: $moddir/switch_root does not exist." + exit 1 +fi inst "$moddir/switch_root" "/sbin/switch_root" inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh"