From 7ee170746fe2448e1c4afbafe0c9f0261eb082d9 Mon Sep 17 00:00:00 2001 From: Warren Togami Date: Thu, 21 May 2009 19:14:50 -0400 Subject: [PATCH] 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.) --- modules.d/99base/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules.d/99base/install b/modules.d/99base/install index c0ce2339..00436ae7 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"