Comment 0 for bug 1778848

Revision history for this message
Ɓukasz Zemczak (sil2100) wrote :

There are multiple use cases which require both BIOS and UEFI bootloaders installed on a target image and to keep them both updated.
- cloud images on clouds that support both BIOS and UEFI boot in alternate instance types
- PC installs that should remain bootable in the face of firmware upgrades or reconfigurations

This currently doesn't work because 'grub-install' selects its install target based on which of grub-pc or grub-efi-amd64 is installed.

We should support a package upgrade workflow that supports updating both bootloaders on disk wherever possible, including use of --no-nvram automatically when necessary, and does not fail awkwardly if e.g. the system is booted under BIOS and there is no EFI System Partition present.

The problem is, if the system is booted in BIOS mode and you call grub-install --target=x86_64-efi, the install will fail because it can't write to EFI nvram variables.

There is a --no-nvram flag, but it's incorrect for us to pass this unconditionally, because it's the wrong thing to do when we are booted in UEFI mode.

So we need some smarts in grub-install for an additional mode that only skips nvram if there is no nvram available.