]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Revert "Change the implementation of action_on_fail"
authordyoung@redhat.com <dyoung@redhat.com>
Mon, 31 Aug 2015 02:43:15 +0000 (10:43 +0800)
committerHarald Hoyer <harald@redhat.com>
Fri, 13 Nov 2015 12:22:34 +0000 (13:22 +0100)
This reverts commit d2765b5175663d094737d6819cc3f3df53e7a4cb.

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/98dracut-systemd/dracut-emergency.service
modules.d/98dracut-systemd/emergency.service
modules.d/99base/dracut-lib.sh

index d790afd3f2d0f2ea5d7883d2c85f58fe22690df7..ad99799012c388ce2134d54398c18600281d8a56 100644 (file)
@@ -159,6 +159,10 @@ Misc
    specify the controlling terminal for the console.
    This is useful, if you have multiple "console=" arguments.
 
+**rd.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 5a6d5250f71d909e3ae97f7fc0aaab047d757795..a4b81bc507c178383055beb3e118f9966db040b3 100644 (file)
@@ -13,7 +13,7 @@ DefaultDependencies=no
 After=systemd-vconsole-setup.service
 Wants=systemd-vconsole-setup.service
 Conflicts=emergency.service emergency.target
-ConditionPathExists=!/lib/dracut/no-emergency-shell
+ConditionKernelCommandLine=!action_on_fail=continue
 
 [Service]
 Environment=HOME=/
index 5f1eaa23b82f36bbc144730451b0c1c00f7562b4..c19fe375aff223dde16ab1036476871049b2cdba 100644 (file)
@@ -12,7 +12,7 @@ Description=Emergency Shell
 DefaultDependencies=no
 After=systemd-vconsole-setup.service
 Wants=systemd-vconsole-setup.service
-ConditionPathExists=!/lib/dracut/no-emergency-shell
+ConditionKernelCommandLine=!action_on_fail=continue
 
 [Service]
 Environment=HOME=/
index 03a283cb74eb4cc26b5d0d702b58d144feafad97..cc5bb42613abdafa07d7070b1f7d6ed2b40c394d 100755 (executable)
@@ -1143,16 +1143,24 @@ emergency_shell()
 
 action_on_fail()
 {
-    if [ -f "$initdir/lib/dracut/no-emergency-shell" ]; then
-        [ "$1" = "-n" ] && shift 2
-        [ "$1" = "--shutdown" ] && shift 2
-        warn "$*"
-        warn "Not dropping to emergency shell, because $initdir/lib/dracut/no-emergency-shell exists."
-        return 0
-    fi
-
-    emergency_shell $@
-    return 1
+    local _action=$(getarg rd.action_on_fail= -d 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