Kexec/kexec-load: Difference between revisions

From Alpine Linux
(Zcrayfish created the page Kexec/kexec-load using a non-default content model "plain text": This will be a plain text page)
 
m (typo)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
#!/sbin/openrc-run
description="kexec for faster reboot"
# Define defaults
: "${BOOTPART:=/boot}"
: "${KERNEL:=vmlinuz-$(uname -r | awk -F \- '{print $NF }')}"
: "${INITRD:=initramfs-$(uname -r | awk -F \- '{print $NF}')}"


depend() {
need localmount
}
start() {
:
}
stop() {
if ! yesno ${RC_GOINGDOWN}; then
einfo "kexec-load: Not rebooting or powering off; not loading kernel"
exit
fi
ebegin "kexec-load: loading kernel for faster reboot"
kexec -l "${BOOTPART}/${KERNEL}" \
--initrd "${BOOTPART}/${INITRD}" \
--reuse-cmdline
ewend $? Failed.
}

Latest revision as of 12:22, 15 January 2024

#!/sbin/openrc-run description="kexec for faster reboot" # Define defaults : "${BOOTPART:=/boot}" : "${KERNEL:=vmlinuz-$(uname -r | awk -F \- '{print $NF }')}" : "${INITRD:=initramfs-$(uname -r | awk -F \- '{print $NF}')}" depend() { need localmount } start() { : } stop() { if ! yesno ${RC_GOINGDOWN}; then einfo "kexec-load: Not rebooting or powering off; not loading kernel" exit fi ebegin "kexec-load: loading kernel for faster reboot" kexec -l "${BOOTPART}/${KERNEL}" \ --initrd "${BOOTPART}/${INITRD}" \ --reuse-cmdline ewend $? Failed. }