Merge pull request #1394 from gportay/set-efi-bootnext

[bootloader] Set the EFI Boot Next
This commit is contained in:
Adriaan de Groot 2020-05-06 13:10:13 +02:00 committed by GitHub
commit 7c633f1253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -403,6 +403,21 @@ def install_secureboot(efi_directory):
"-p", efi_partition_number,
"-l", install_efi_directory + "/" + install_efi_bin])
boot_entry = None
efi_bootvars = subprocess.check_output(
[libcalamares.job.configuration["efiBootMgr"]], text=True)
for line in efi_bootvars.split('\n'):
if not line:
continue
words = line.split()
if len(words) >= 2 and words[0] == "BootOrder:":
boot_entry = words[1].split(',')[0]
break
if boot_entry:
subprocess.call([
libcalamares.job.configuration["efiBootMgr"],
"-n", boot_entry])
# The input file /etc/default/grub should already be filled out by the
# grubcfg job module.
check_target_env_call([libcalamares.job.configuration["grubMkconfig"],