From b978858fec0a84194e9bd0ca83d7729332c7ad23 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 8 Jun 2012 10:23:37 -0400 Subject: check for a loaded kernel on reboot 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 --- rc.shutdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rc.shutdown') 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 /dev/null + if (( kexec_loaded )); then + action="kexec" + else + action="reboot" + fi fi # make /run/initrafs a mount -- cgit v1.2.3