diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-11-25 21:24:58 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-11-25 21:24:58 +0100 |
commit | 16262790cb6ddacf6c632625cc865e03b1b8671f (patch) | |
tree | 09898d65deef518380915ecdc7575756c9ca8595 /src/kexec-tools/kexec | |
parent | 7bb1499a7cd539f714bb7f603d7fc0a38fd8a963 (diff) | |
download | rcdscripts-16262790cb6ddacf6c632625cc865e03b1b8671f.tar.xz |
rcdscripts: import first snapshot of rc.d scripts as of 11.25.20122012.11.25
In 30 days these scripts will start dissapearing from official Arch
Linux packages. This is an attempt to conserve them, and keep sysvinit
usable.
Diffstat (limited to 'src/kexec-tools/kexec')
-rwxr-xr-x | src/kexec-tools/kexec | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/kexec-tools/kexec b/src/kexec-tools/kexec new file mode 100755 index 0000000..c2e9a78 --- /dev/null +++ b/src/kexec-tools/kexec @@ -0,0 +1,45 @@ +#!/bin/bash + +[ -f /etc/conf.d/kexec ] && . /etc/conf.d/kexec + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Enabling kexec on reboot" + add_daemon kexec + stat_done + ;; + + stop|load) + if [ "$RUNLEVEL" = "6" -o "$1" = "load" ]; then + stat_busy "Loading kexec kernel" + [ -f "$KPATH" ] || stat_fail + [ -f "$INITRD" ] && _INITRD="--initrd=$INITRD" + /sbin/kexec -l $KPATH --append="root=$ROOTPART $KPARAM" $_INITRD > /dev/null 2>&1 + else + stat_busy "Disabling kexec on reboot" + fi + if [ $? -eq 0 ] ; then + rm_daemon kexec + stat_done + else + stat_fail + fi + ;; + + unload) + stat_busy "Unloading kexec kernel" + /sbin/kexec -u + if [ $? -eq 0 ] ; then + stat_done + else + stat_fail + fi + ;; + + *) + echo "usage: $0 {start|stop|load|unload}" +esac +exit 0 |