diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2022-10-24 22:03:49 +0100 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2022-10-24 22:03:49 +0100 |
commit | 4db36433bd629747578ba1e60aff425066dac140 (patch) | |
tree | 0ff37c59f0cd39780d5231f601a0c56c360740df /perl-install/bootloader.pm | |
parent | 325cbdb1eeff9310c305bfb4c29bf7f03556655f (diff) | |
download | drakx-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/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 4 |
1 files changed, 4 insertions, 0 deletions
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 { |