From 4db36433bd629747578ba1e60aff425066dac140 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 24 Oct 2022 22:03:49 +0100 Subject: Ensure efivars are mounted before installing a UEFI bootloader (mga#31008) The old way of accessing EFI NVRAM variables via /sys/firmware/efi/vars was removed in Linux 6.0. The new way is to use the efivarfs pseudo- filesystem, which is usually mounted at /sys/firmware/efi/efivars. We need to make sure this is actually mounted before attempting to install a UEFI bootloader, otherwise any attempt to write to the EFI NVRAM will fail. --- perl-install/bootloader.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'perl-install/bootloader.pm') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 50b676fc0..ad7850d40 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -2629,8 +2629,12 @@ Writes back the boot loader config. Calls the proper write_XYZ() function. sub install { my ($bootloader, $all_hds) = @_; + my ($efivars, $already_mounted) = mount_efivars() if is_uefi(); + $bootloader->{keytable} = keytable($bootloader->{keytable}) if $bootloader->{method} eq 'lilo'; action($bootloader, 'install', $all_hds); + + run_program::run('umount', $efivars) if is_uefi() && !$already_mounted; } sub ensure_pkg_is_installed { -- cgit v1.2.1