loader/emu/linux: Fix determination of program name

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>
This commit is contained in:
Vladimir Serbinenko 2024-06-17 15:56:31 +03:00 committed by Daniel Kiper
parent 828717833f
commit f171122f03
2 changed files with 2 additions and 2 deletions

View 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");

View 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);