Address feedback from Raymund's review. Interdiff attached. Be well, --Robbie
Raymund Will (1): Add support for grub-emu to kexec Linux menu entries grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 2 +- grub-core/kern/emu/main.c | 4 + grub-core/kern/emu/misc.c | 18 +++- grub-core/loader/emu/linux.c | 181 +++++++++++++++++++++++++++++++++++ include/grub/emu/exec.h | 4 +- include/grub/emu/hostfile.h | 3 +- include/grub/emu/misc.h | 3 + 8 files changed, 212 insertions(+), 4 deletions(-) create mode 100644 grub-core/loader/emu/linux.c Interdiff against v3: diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c index b4da9d21cf..855b11c3de 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -107,7 +107,7 @@ static struct argp_option options[] = { N_("use GRUB files in the directory DIR [default=%s]"), 0}, {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, {"hold", 'H', N_("SECS"), OPTION_ARG_OPTIONAL, N_("wait until a debugger will attach"), 0}, - {"kexec", 'X', 0, 0, N_("use kexec to boot Linux kernels."), 0}, + {"kexec", 'X', 0, 0, N_("use kexec to boot Linux kernels via systemctl (pass twice to enable dangerous fallback to non-systemctl)."), 0}, { 0, 0, 0, 0, 0, 0 } }; diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c index b5ea48a677..bdcdbb0ff4 100644 --- a/grub-core/loader/emu/linux.c +++ b/grub-core/loader/emu/linux.c @@ -77,9 +77,10 @@ grub_linux_boot (void) rc = grub_util_exec (systemctl); if (kexecute == 1) - grub_error (rc, N_("Error trying to perform 'systemctl kexec'")); + grub_fatal (N_("Error trying to perform 'systemctl kexec'")); - /* need to check read-only root before resetting hard!? */ + /* WARNING: forcible reset should only be used in read-only environments. + * grub-emu cannot check for these - users beware. */ grub_dprintf ("linux", "Performing 'kexec -e -x'"); kexec[1] = "-e"; kexec[2] = "-x"; -- 2.35.1 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel