You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I note that openrc-shutdown supports --kexec option. Does it mean it is possible to load a kernel and initrd and then have openrc call kexec to boot the loaded kernel instead of doing a normal reboot? If so, how can I enable this option?
I tried calling openrc-shutdown manually, but that does not work. It says it will reboot, but nothing actually happens.
# openrc-shutdown -v --kexec now
Broadcast message from root@static (pts/0) (Sun Feb 2 18:16:31 2025):
The system will reboot now
Using Gentoo with openrc-0.55.1
For now I created a service kexec-boot that I added to the shutdown runlevel.
#!/sbin/openrc-run
description="Execute kexec if a kernel is preloaded, otherwise do a normal reboot"depend() {
after *
}
start_pre() {
if yesno ${RC_REBOOT};thenif [ -f /sys/kernel/kexec_loaded ] && [ "$(cat /sys/kernel/kexec_loaded)"-eq 1 ];then
einfo "Executing kexec..."
sleep 10
kexec -e
eerror "kexec failed, proceeding with normal reboot"fifi
}
status() {
if [ -f /sys/kernel/kexec_loaded ] && [ "$(cat /sys/kernel/kexec_loaded)"-eq 1 ];then
einfo "A kernel is loaded for kexec"else
einfo "No kernel is loaded for kexec"fi
}
The text was updated successfully, but these errors were encountered:
Hi,
I note that openrc-shutdown supports
--kexec
option. Does it mean it is possible to load a kernel and initrd and then have openrc call kexec to boot the loaded kernel instead of doing a normal reboot? If so, how can I enable this option?I tried calling
openrc-shutdown
manually, but that does not work. It says it will reboot, but nothing actually happens.Using Gentoo with openrc-0.55.1
For now I created a service
kexec-boot
that I added to theshutdown
runlevel.The text was updated successfully, but these errors were encountered: