]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Revert "Let user specify the action after fail"
authordyoung@redhat.com <dyoung@redhat.com>
Mon, 31 Aug 2015 02:43:20 +0000 (10:43 +0800)
committerHarald Hoyer <harald@redhat.com>
Fri, 13 Nov 2015 12:22:34 +0000 (13:22 +0100)
This reverts commit 9d787df19674937e8c07bd295b5d282a63829209

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
dracut.cmdline.7.asc
modules.d/95rootfs-block/mount-root.sh
modules.d/98dracut-systemd/dracut-initqueue.sh
modules.d/98dracut-systemd/dracut-mount.sh
modules.d/98selinux/selinux-loadpolicy.sh
modules.d/98usrmount/mount-usr.sh
modules.d/99base/dracut-lib.sh
modules.d/99base/init.sh

index cd8cc66ad8dec878a60a8a8a7b439d39034a002f..d790afd3f2d0f2ea5d7883d2c85f58fe22690df7 100644 (file)
@@ -159,10 +159,6 @@ Misc
    specify the controlling terminal for the console.
    This is useful, if you have multiple "console=" arguments.
 
-**action_on_fail=**_{shell|continue}_::
-   Specify the action after failure. By default it's emergency_shell.
-   'continue' means: ignore the current failure and go ahead.
-
 [[dracutkerneldebug]]
 Debug
 ~~~~~
index 7e9c5bb6f27c504da50fb1e763d47480987d8729..924393bd9b932e2c4bdfc5c850c7c88a6506a5ad 100755 (executable)
@@ -66,7 +66,7 @@ mount_root() {
                 warn "*** Warning -- the system did not shut down cleanly. "
                 warn "*** Dropping you to a shell; the system will continue"
                 warn "*** when you leave the shell."
-                action_on_fail
+                emergency_shell
             fi
             fsckoptions="$AUTOFSCK_OPT $fsckoptions"
         fi
index 881f6397bbb7b38e38a341d606b68dd6ff7155aa..3ddc2362eac2981545fe61ec63438bbb489c7c65 100755 (executable)
@@ -68,7 +68,7 @@ while :; do
     main_loop=$(($main_loop+1))
     if [ $main_loop -gt $RDRETRY ]; then
         if ! [ -f /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then
-            action_on_fail "Could not boot." && break
+            emergency_shell "Could not boot."
         fi
         warn "Not all disks have been found."
         warn "You might want to regenerate your initramfs."
index 11ba7bcc682b4915c12bb4550c47eba264058d1d..c4febfeb1eb0e726a9ad922e36b5056cc8d12ee6 100755 (executable)
@@ -29,7 +29,7 @@ while :; do
     done
 
     i=$(($i+1))
-    [ $i -gt 20 ] && action_on_fail "Can't mount root filesystem" && break
+    [ $i -gt 20 ] && emergency_shell "Can't mount root filesystem"
 done
 
 export -p > /dracut-state.sh
index d0ac834e2e4d721cd2ce65f061c3f4e7eece4a78..ca81a38361e187b3feee89400a2bb54c44ca495c 100755 (executable)
@@ -54,14 +54,16 @@ rd_load_policy()
         if [ $ret -eq 3 -o $permissive -eq 0 ]; then
             warn "Machine in enforcing mode."
             warn "Not continuing"
-            action_on_fail -n selinux || exit 1
+            emergency_shell -n selinux
+            exit 1
         fi
         return 0
     elif [ $permissive -eq 0 -a "$SELINUX" != "disabled" ]; then
         warn "Machine in enforcing mode and cannot execute load_policy."
         warn "To disable selinux, add selinux=0 to the kernel command line."
         warn "Not continuing"
-        action_on_fail -n selinux || exit 1
+        emergency_shell -n selinux
+        exit 1
     fi
 }
 
index d1a629c6b9874f6e6b25e49b64b96f496c57b15f..1699604c29ee2cbd3cc9bd03c1994dc8da410069 100755 (executable)
@@ -40,7 +40,7 @@ fsck_usr()
             warn "*** Warning -- the system did not shut down cleanly. "
             warn "*** Dropping you to a shell; the system will continue"
             warn "*** when you leave the shell."
-            action_on_fail
+            emergency_shell
         fi
         _fsckoptions="$AUTOFSCK_OPT $_fsckoptions"
     fi
@@ -103,7 +103,7 @@ mount_usr()
             warn "Mounting /usr to $NEWROOT/usr failed"
             warn "*** Dropping you to a shell; the system will continue"
             warn "*** when you leave the shell."
-            action_on_fail
+            emergency_shell
         fi
     fi
 }
index 1ac9b3cefe1022e4b8388a24ff24e9f938df762b..d3a7b591668cf0e3b80bc18a1bd0e33f9e0c3dde 100755 (executable)
@@ -1141,28 +1141,6 @@ emergency_shell()
     fi
 }
 
-action_on_fail()
-{
-    local _action=$(getarg action_on_fail=)
-    case "$_action" in
-        continue)
-            [ "$1" = "-n" ] && shift 2
-            [ "$1" = "--shutdown" ] && shift 2
-            warn "$*"
-            warn "Not dropping to emergency shell, because 'action_on_fail=continue' was set on the kernel command line."
-            return 0
-            ;;
-        shell)
-            emergency_shell $@
-            return 1
-            ;;
-        *)
-            emergency_shell $@
-            return 1
-            ;;
-    esac
-}
-
 # Retain the values of these variables but ensure that they are unexported
 # This is a POSIX-compliant equivalent of bash's "export -n"
 export_n()
index a59e8eac2c9927e6d5b2b1b123ab06dc2b106a71..e2e40298a5f405aa6e894df54baf37fcbcb80e12 100755 (executable)
@@ -85,7 +85,7 @@ if command -v kmod >/dev/null 2>/dev/null; then
         done
 fi
 
-trap "action_on_fail Signal caught!" 0
+trap "emergency_shell Signal caught!" 0
 
 export UDEVVERSION=$(udevadm --version)
 if [ $UDEVVERSION -gt 166 ]; then
@@ -214,7 +214,7 @@ while :; do
 
     main_loop=$(($main_loop+1))
     [ $main_loop -gt $RDRETRY ] \
-        && { flock -s 9 ; action_on_fail "Could not boot." && break; } 9>/.console_lock
+        && { flock -s 9 ; emergency_shell "Could not boot."; } 9>/.console_lock
 done
 unset job
 unset queuetriggered
@@ -249,7 +249,7 @@ while :; do
 
     _i_mount=$(($_i_mount+1))
     [ $_i_mount -gt 20 ] \
-        && { flock -s 9 ; action_on_fail "Can't mount root filesystem" && break; } 9>/.console_lock
+        && { flock -s 9 ; emergency_shell "Can't mount root filesystem"; } 9>/.console_lock
 done
 
 {
@@ -283,7 +283,7 @@ done
 [ "$INIT" ] || {
     echo "Cannot find init!"
     echo "Please check to make sure you passed a valid root filesystem!"
-    action_on_fail
+    emergency_shell
 }
 
 if [ $UDEVVERSION -lt 168 ]; then
@@ -387,13 +387,13 @@ if [ -f /etc/capsdrop ]; then
        warn "Command:"
        warn capsh --drop=$CAPS_INIT_DROP -- -c exec switch_root "$NEWROOT" "$INIT" $initargs
        warn "failed."
-       action_on_fail
+       emergency_shell
     }
 else
     unset RD_DEBUG
     exec $SWITCH_ROOT "$NEWROOT" "$INIT" $initargs || {
        warn "Something went very badly wrong in the initramfs.  Please "
        warn "file a bug against dracut."
-       action_on_fail
+       emergency_shell
     }
 fi