From f1ad4d3de9990c96de726b057dd37ba5b296f329 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Thu, 6 Sep 2018 16:06:41 +0200 Subject: [PATCH] mxgrub: Add switch `no-nvram` to `grub-install` for UEFI In case a drive with an EFI System Partition (ESP) is put into a system that boots in legacy mode, running `grub-install --target=x86_64-efi` will fail, as `efibootmgr` fails to update the NVRAM. Therefore, pass `--no-nvram` to `grub-install`, which skip running efibootmgr. --no-nvram don't update the `boot-device'/`Boot*' NVRAM variables. This option is only available on EFI and IEEE1275 targets. As a downside, the administrator needs to go int the firmware menu, and add the entry in the boot manager manually. --- mxgrub/mxgrub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mxgrub/mxgrub b/mxgrub/mxgrub index ac8e71e..b2a5178 100755 --- a/mxgrub/mxgrub +++ b/mxgrub/mxgrub @@ -321,7 +321,7 @@ sub cmd_install { print "GRUB for UEFI is already installed.\n"; } else { - sys 'grub-install','--target=x86_64-efi',$root_disk and exit 1; + sys 'grub-install','--target=x86_64-efi','--no-nvram',$root_disk and exit 1; } sys 'umount','/boot/efi' and exit 1; }