Skip to content

Commit

Permalink
mxgrub: Add switch no-nvram to grub-install for UEFI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pmenzel committed Sep 6, 2018
1 parent 3c6c695 commit f1ad4d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f1ad4d3

Please sign in to comment.