Skip to content

Commit

Permalink
curthooks: check for non-availability of EFI variables
Browse files Browse the repository at this point in the history
Some UEFI firmware does not support EFI variables at runtime.
In this case directory /sys/firmware/efi/efivars does not exist.
This would lead to an exception when calling efibootmgr.

Signed-off-by: Heinrich Schuchardt <[email protected]>
  • Loading branch information
xypron committed Jan 26, 2023
1 parent c0354b3 commit db8f452
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion curtin/commands/curthooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,11 @@ def setup_grub(cfg, target, osfamily=DISTROS.debian, variant=None):
else:
instdevs = ["none"]

update_nvram = grubcfg.get('update_nvram', True)
if util.is_efivars_writable():
update_nvram = grubcfg.get('update_nvram', True)
else:
update_nvram = False

if uefi_bootable and update_nvram:
efi_orig_output = util.get_efibootmgr(target)
uefi_remove_old_loaders(grubcfg, target)
Expand Down

0 comments on commit db8f452

Please sign in to comment.