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

This version syncs with the openSUSE version of the patch.  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 | 180 +++++++++++++++++++++++++++++++++++
 include/grub/emu/exec.h      |   4 +-
 include/grub/emu/hostfile.h  |   3 +-
 include/grub/emu/misc.h      |   3 +
 8 files changed, 211 insertions(+), 4 deletions(-)
 create mode 100644 grub-core/loader/emu/linux.c

Interdiff against v2:
diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c
index 020cf56cd1..b5ea48a677 100644
--- a/grub-core/loader/emu/linux.c
+++ b/grub-core/loader/emu/linux.c
@@ -38,7 +38,7 @@ grub_linux_boot (void)
 {
   grub_err_t rc = GRUB_ERR_NONE;
   char *initrd_param;
-  const char *kexec[] = { "kexec", "-l", kernel_path, boot_cmdline, NULL, NULL };
+  const char *kexec[] = { "kexec", "-la", kernel_path, boot_cmdline, NULL, NULL };
   const char *systemctl[] = { "systemctl", "kexec", NULL };
   int kexecute = grub_util_get_kexecute ();
 
@@ -53,7 +53,7 @@ grub_linux_boot (void)
       initrd_param = grub_xasprintf ("%s", "");
     }
 
-  grub_dprintf ("linux", "%serforming 'kexec -l %s %s %s'\n",
+  grub_dprintf ("linux", "%serforming 'kexec -la %s %s %s'\n",
                 (kexecute) ? "P" : "Not p",
                 kernel_path, initrd_param, boot_cmdline);
 
@@ -76,10 +76,8 @@ grub_linux_boot (void)
 		(kexecute==1) ? "do-or-die" : "just-in-case");
   rc = grub_util_exec (systemctl);
 
-  if (rc == GRUB_ERR_NONE)
-    return rc;
-
-  grub_error (rc, N_("Error trying to perform 'systemctl kexec'"));
+  if (kexecute == 1)
+    grub_error (rc, N_("Error trying to perform 'systemctl kexec'"));
 
   /* need to check read-only root before resetting hard!? */
   grub_dprintf ("linux", "Performing 'kexec -e -x'");
-- 
2.35.1



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

end of thread, other threads:[~2022-08-24 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23 21:15 [PATCH v3 0/1] Add support for grub-emu to kexec Linux menu entries Robbie Harwood
2022-08-23 21:15 ` [PATCH v3 1/1] " Robbie Harwood
2022-08-24 10:35   ` Raymund Will
2022-08-24 14:29     ` Robbie Harwood

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.