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/NEWS | 2 ++ perl-install/bootloader.pm | 4 ++++ perl-install/install/NEWS | 2 ++ 3 files changed, 8 insertions(+) diff --git a/perl-install/NEWS b/perl-install/NEWS index 5be58f816..41220654d 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- drakboot: ensure efivars are mounted before installing a UEFI bootloader (mga#31008) + Version 18.50 - 17 September 2022 - drakboot: add options to change the rEFInd background (mga#28073) 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 { diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index ddda27edf..a97e6cc54 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,5 @@ +- bootloader: ensure efivars are mounted before installing a UEFI bootloader (mga#31008) + Version 18.50 - 17 September 2022 - bootloader: don't remove existing failsafe/nonfb entries on upgrade -- cgit v1.2.1