public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
From: dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: [patch 1/6] [PATCH 1/5] Revert "Change the implementation of action_on_fail"
Date: Mon, 31 Aug 2015 10:43:15 +0800	[thread overview]
Message-ID: <20150831024413.784687500@redhat.com> (raw)
In-Reply-To: 20150831024314.798498962@redhat.com

[-- Attachment #1: 0001-Revert-Change-the-implementation-of-action_on_fail.patch --]
[-- Type: text/plain, Size: 3351 bytes --]

This reverts commit d2765b5175663d094737d6819cc3f3df53e7a4cb.

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

Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 dracut.cmdline.7.asc                               |  4 ++++
 .../98dracut-systemd/dracut-emergency.service      |  2 +-
 modules.d/98dracut-systemd/emergency.service       |  2 +-
 modules.d/99base/dracut-lib.sh                     | 28 ++++++++++++++--------
 4 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 8c7e965..07d3a93 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -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
 ~~~~~
diff --git a/modules.d/98dracut-systemd/dracut-emergency.service b/modules.d/98dracut-systemd/dracut-emergency.service
index 5a6d525..a4b81bc 100644
--- a/modules.d/98dracut-systemd/dracut-emergency.service
+++ b/modules.d/98dracut-systemd/dracut-emergency.service
@@ -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=/
diff --git a/modules.d/98dracut-systemd/emergency.service b/modules.d/98dracut-systemd/emergency.service
index 5f1eaa2..c19fe37 100644
--- a/modules.d/98dracut-systemd/emergency.service
+++ b/modules.d/98dracut-systemd/emergency.service
@@ -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=/
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 1eaf4b3..1f50e2f 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -1145,16 +1145,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
-- 
1.8.3.1



  reply	other threads:[~2015-08-31  2:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31  2:43 [patch 0/6] Revert action_on_fail patches dyoung-H+wXaHxf7aLQT0dZR+AlfA
2015-08-31  2:43 ` dyoung-H+wXaHxf7aLQT0dZR+AlfA [this message]
2015-08-31  2:43 ` [patch 2/6] [PATCH 2/5] Revert "rename kernel command line param action_on_fail to rd.action_on_fail" dyoung-H+wXaHxf7aLQT0dZR+AlfA
2015-08-31  2:43 ` [patch 3/6] [PATCH 3/5] Revert "systemd/emergency.service: do not run for action_on_fail=continue" dyoung-H+wXaHxf7aLQT0dZR+AlfA
2015-08-31  2:43 ` [patch 4/6] [PATCH 4/5] Revert "dracut-emergency.service: do not start for "action_on_fail=continue"" dyoung-H+wXaHxf7aLQT0dZR+AlfA
2015-08-31  2:43 ` [patch 5/6] [PATCH 5/5] Revert "99fs-lib/fs-lib.sh: Let user specify the action after fail for fsck" dyoung-H+wXaHxf7aLQT0dZR+AlfA
2015-08-31  2:43 ` [patch 6/6] [PATCH 4/5] Revert "Let user specify the action after fail" dyoung-H+wXaHxf7aLQT0dZR+AlfA
     [not found] ` <20150831024314.798498962-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-29  8:11   ` [patch 0/6] Revert action_on_fail patches Dave Young
     [not found]     ` <20150929081150.GD30623-sa4SJRhfYT7Js+WLOFIw6R/sF2h8X+2i0E9HWUfgJXw@public.gmane.org>
2015-11-13 12:43       ` Harald Hoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150831024413.784687500@redhat.com \
    --to=dyoung-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox