summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2022-10-24 22:03:49 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2022-10-24 22:03:49 +0100
commit4db36433bd629747578ba1e60aff425066dac140 (patch)
tree0ff37c59f0cd39780d5231f601a0c56c360740df /perl-install
parent325cbdb1eeff9310c305bfb4c29bf7f03556655f (diff)
downloaddrakx-4db36433bd629747578ba1e60aff425066dac140.tar
drakx-4db36433bd629747578ba1e60aff425066dac140.tar.gz
drakx-4db36433bd629747578ba1e60aff425066dac140.tar.bz2
drakx-4db36433bd629747578ba1e60aff425066dac140.tar.xz
drakx-4db36433bd629747578ba1e60aff425066dac140.zip
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.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/bootloader.pm4
-rw-r--r--perl-install/install/NEWS2
3 files changed, 8 insertions, 0 deletions
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