summaryrefslogtreecommitdiff
path: root/rc.shutdown
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-06-08 10:23:37 -0400
committerDave Reisner <dreisner@archlinux.org>2012-06-08 10:24:29 -0400
commitb978858fec0a84194e9bd0ca83d7729332c7ad23 (patch)
treeb216a9a00347af28d4f21a6cc3e10ac58197bd04 /rc.shutdown
parent2b88be43076a5e3019da62b3b188d3f061b105ea (diff)
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 <dreisner@archlinux.org>
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-xrc.shutdown7
1 files changed, 6 insertions, 1 deletions
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