grub-devel
[Top][All Lists]
Advanced

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

[PATCH 2/2] emu/linux: Fix determination of program name


From: Vladimir Serbinenko
Subject: [PATCH 2/2] emu/linux: Fix determination of program name
Date: Mon, 17 Jun 2024 15:56:31 +0300

Current code works only if package matches binary name transformation rules.
It's often true but is no waz guaranteed

Fixes bug #64410

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 grub-core/loader/emu/linux.c | 3 ++-
 include/grub/emu/misc.h      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c
index 7de3f7f86..2a55b8387 100644
--- a/grub-core/loader/emu/linux.c
+++ b/grub-core/loader/emu/linux.c
@@ -68,7 +68,8 @@ grub_linux_boot (void)
     }
 
   if (kexecute < 1)
-    grub_fatal (N_("use '"PACKAGE"-emu --kexec' to force a system restart"));
+    grub_fatal (N_("use '%s %s' to force a system restart"),
+               program_name, "--kexec");
 
   grub_dprintf ("linux", "Performing 'systemctl kexec' (%s) ",
                (kexecute==1) ? "do-or-die" : "just-in-case");
diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h
index 01056954b..fa959ebe7 100644
--- a/include/grub/emu/misc.h
+++ b/include/grub/emu/misc.h
@@ -31,7 +31,7 @@
 #include <grub/util/misc.h>
 
 extern int verbosity;
-extern const char *program_name;
+extern const char *EXPORT_VAR(program_name);
 
 void grub_init_all (void);
 void grub_fini_all (void);
-- 
2.39.2




reply via email to

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