8 Jun
2012
8 Jun
'12
2:58 p.m.
Explicitly pass "kexec" to the shutdown script if we detect a preloaded kernel already in memory. We mask read errors for custom kernels where kexec is not available. Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- rc.shutdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc.shutdown b/rc.shutdown index d0d8405..78f56c4 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -82,7 +82,12 @@ if [[ -x /run/initramfs/shutdown ]]; then if [[ $RUNLEVEL = 0 ]]; then action="poweroff" else - action="reboot" + { read kexec_loaded </sys/kernel/kexec_loaded; } 2>/dev/null + if (( kexec_loaded )); then + action="kexec" + else + action="reboot" + fi fi # make /run/initrafs a mount -- 1.7.10.4