]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Abort if switch_root does not exist.
authorWarren Togami <wtogami@redhat.com>
Thu, 21 May 2009 23:14:50 +0000 (19:14 -0400)
committerWarren Togami <wtogami@redhat.com>
Thu, 21 May 2009 23:14:50 +0000 (19:14 -0400)
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

index c0ce2339fb4142eeda1181249fe980d6c707370d..00436ae77af04a1e3ed3c31fbb98c37bf01d5493 100755 (executable)
@@ -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"