]> git.ipfire.org Git - thirdparty/grub.git/commit
loader: Add support for grub-emu to kexec Linux menu entries
authorRaymund Will <rw@suse.com>
Mon, 24 Oct 2022 18:33:50 +0000 (14:33 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Nov 2022 16:13:24 +0000 (17:13 +0100)
commite364307f6acc2f631b4c1fefda0791b9ce1f205f
tree273a2d0140e878ecd82e9091ff03a18affb0a4e9
parent62037e01b296fe772c1724343cf75b75ea52e220
loader: Add support for grub-emu to kexec Linux menu entries

The GRUB emulator is used as a debugging utility but it could also be
used as a user-space bootloader if there is support to boot an operating
system.

The Linux kernel is already able to (re)boot another kernel via the
kexec boot mechanism. So the grub-emu tool could rely on this feature
and have linux and initrd commands that are used to pass a kernel,
initramfs image and command line parameters to kexec for booting
a selected menu entry.

By default the systemctl kexec option is used so systemd can shutdown
all of the running services before doing a reboot using kexec. But if
this is not present, it can fall back to executing the kexec user-space
tool directly. The ability to force a kexec-reboot when systemctl kexec
fails must only be used in controlled environments to avoid possible
filesystem corruption and data loss.

Signed-off-by: Raymund Will <rw@suse.com>
Signed-off-by: John Jolly <jjolly@suse.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
docs/grub.texi
grub-core/Makefile.am
grub-core/Makefile.core.def
grub-core/kern/emu/main.c
grub-core/kern/emu/misc.c
grub-core/loader/emu/linux.c [new file with mode: 0644]
include/grub/emu/exec.h
include/grub/emu/hostfile.h
include/grub/emu/misc.h