Change the implementation of action_on_fail
Currently when action_on_fail is enabled, the emergency_shell won't be called. In kdump even though user specify the default action as emergency_shell, dracut skip it. Now change the implementation of action_on_fail to depend on a file which is created by kdump when making kdump initrd, then remove it at the beginning of kdump. This can solve the explicit emergency_shell problem. And action_on_fail won't need paramenters, remove the relevant description in dracut man page. Signed-off-by: Baoquan He <bhe@redhat.com>master
parent
d27cd4dfdd
commit
d2765b5175
|
@ -121,10 +121,6 @@ Misc
|
||||||
specify the controlling terminal for the console.
|
specify the controlling terminal for the console.
|
||||||
This is useful, if you have multiple "console=" arguments.
|
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]]
|
[[dracutkerneldebug]]
|
||||||
Debug
|
Debug
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
|
@ -13,7 +13,7 @@ DefaultDependencies=no
|
||||||
After=systemd-vconsole-setup.service
|
After=systemd-vconsole-setup.service
|
||||||
Wants=systemd-vconsole-setup.service
|
Wants=systemd-vconsole-setup.service
|
||||||
Conflicts=emergency.service emergency.target
|
Conflicts=emergency.service emergency.target
|
||||||
ConditionKernelCommandLine=!action_on_fail=continue
|
ConditionPathExists=!/lib/dracut/no-emergency-shell
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=HOME=/
|
Environment=HOME=/
|
||||||
|
|
|
@ -12,7 +12,7 @@ Description=Emergency Shell
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=systemd-vconsole-setup.service
|
After=systemd-vconsole-setup.service
|
||||||
Wants=systemd-vconsole-setup.service
|
Wants=systemd-vconsole-setup.service
|
||||||
ConditionKernelCommandLine=!action_on_fail=continue
|
ConditionPathExists=!/lib/dracut/no-emergency-shell
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=HOME=/
|
Environment=HOME=/
|
||||||
|
|
|
@ -1030,24 +1030,16 @@ emergency_shell()
|
||||||
|
|
||||||
action_on_fail()
|
action_on_fail()
|
||||||
{
|
{
|
||||||
local _action=$(getarg rd.action_on_fail= -d action_on_fail=)
|
if [ -f "$initdir/lib/dracut/no-emergency-shell" ]; then
|
||||||
case "$_action" in
|
|
||||||
continue)
|
|
||||||
[ "$1" = "-n" ] && shift 2
|
[ "$1" = "-n" ] && shift 2
|
||||||
[ "$1" = "--shutdown" ] && shift 2
|
[ "$1" = "--shutdown" ] && shift 2
|
||||||
warn "$*"
|
warn "$*"
|
||||||
warn "Not dropping to emergency shell, because 'action_on_fail=continue' was set on the kernel command line."
|
warn "Not dropping to emergency shell, because $initdir/lib/dracut/no-emergency-shell exists."
|
||||||
return 0
|
return 0
|
||||||
;;
|
fi
|
||||||
shell)
|
|
||||||
emergency_shell $@
|
emergency_shell $@
|
||||||
return 1
|
return 1
|
||||||
;;
|
|
||||||
*)
|
|
||||||
emergency_shell $@
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Retain the values of these variables but ensure that they are unexported
|
# Retain the values of these variables but ensure that they are unexported
|
||||||
|
|
Loading…
Reference in New Issue