All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/1] Add support for grub-emu to kexec Linux menu entries
@ 2022-10-04 19:16 Robbie Harwood
  2022-10-04 19:16 ` [PATCH v4 1/1] " Robbie Harwood
  0 siblings, 1 reply; 7+ messages in thread
From: Robbie Harwood @ 2022-10-04 19:16 UTC (permalink / raw)
  To: grub-devel; +Cc: Robbie Harwood, dkiper, rw

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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-19 18:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-04 19:16 [PATCH v4 0/1] Add support for grub-emu to kexec Linux menu entries Robbie Harwood
2022-10-04 19:16 ` [PATCH v4 1/1] " Robbie Harwood
2022-10-14 11:11   ` Daniel Kiper
2022-10-19 18:06     ` Robbie Harwood
2022-10-16 19:18   ` Oskari Pirhonen
2022-10-18 19:26     ` Robbie Harwood
2022-10-19  7:02       ` Oskari Pirhonen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.