]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
loader/emu/linux: Fix determination of program name
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 17 Jun 2024 12:56:31 +0000 (15:56 +0300)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 20 Jun 2024 17:11:48 +0000 (19:11 +0200)
Current code works only if package matches binary name transformation rules.
It's often true but is not guaranteed.

Fixes: https://savannah.gnu.org/bugs/?64410
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/emu/linux.c
include/grub/emu/misc.h

index 7de3f7f86105f6b297414c074f9cd59139129798..638c55bf83007742344295d9a2acb23045f4cf6e 100644 (file)
@@ -68,7 +68,7 @@ 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");
index 01056954b96988bafbf03132d63167dcf708f389..fa959ebe71c2142628516b95484c51b5d25e21aa 100644 (file)
@@ -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);