grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3] Add --noefistub option for linux


From: Vladimir Serbinenko
Subject: [PATCH v3] Add --noefistub option for linux
Date: Mon, 17 Jun 2024 14:52:07 +0300

In some cases like loading kernel from native disk (e.g. nvme) not
supported by EFI in question efi stub is not an option. Allow
user to disable efi stub and fallback to older protocol

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 grub-core/loader/efi/linux.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index bfbd95aee..e70017a78 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -459,10 +459,18 @@ grub_cmd_linux (grub_command_t cmd __attribute__ 
((unused)),
   grub_file_t file = 0;
   struct linux_arch_kernel_header lh;
   grub_err_t err;
+  bool force_legacy = false;
 
   grub_dl_ref (my_mod);
 
-  if (grub_is_shim_lock_enabled () == true)
+  if (argc > 0 && grub_strcmp(argv[0], "--noefistub") == 0)
+    {
+      force_legacy = true;
+      argv++;
+      argc--;
+    }
+
+  if (grub_is_shim_lock_enabled () == true || force_legacy)
     {
 #if defined(__i386__) || defined(__x86_64__)
       grub_dprintf ("linux", "shim_lock enabled, falling back to legacy Linux 
kernel loader\n");
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]