From ec7c5a4611182368e9c4844724d31ac2c8edc382 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Sun, 12 May 2019 16:11:35 +0200 Subject: [PATCH] [bootloader] Fix sb-shim mode to write grub.cfg into the ESP src/modules/bootloader/main.py (install_secureboot): Run the configured grubMkconfig command (should be `grub-mkconfig` or `grub2-mkconfig`) to create `/boot/efi/EFI/$efi_bootloader_id/grub.cfg`. The sb-shim is just a chainloader to GRUB 2, which expects a grub.cfg in that location, so something has to create it or the installed system will not boot beyond the GRUB rescue shell. (install_grub): Fix misleading comment above the grubMkconfig call: it is not the file specified in grubCfg that should be already filled out by the grubcfg job module, that file is written by `grub*-mkconfig` using `/etc/default/grub` as the input file. It is that input file `/etc/default/grub` that should already be filled out by the grubcfg job module. (The same input file is used in install_secureboot.) --- src/modules/bootloader/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 40e9f1613..9d705adfc 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -7,7 +7,7 @@ # Copyright 2014, Anke Boersma # Copyright 2014, Daniel Hillenbrand # Copyright 2014, Benjamin Vaudour -# Copyright 2014, Kevin Kofler +# Copyright 2014-2019, Kevin Kofler # Copyright 2015-2018, Philip Mueller # Copyright 2016-2017, Teo Mrnjavac # Copyright 2017, Alf Gaida @@ -339,8 +339,8 @@ def install_grub(efi_directory, fw_type): "--force", boot_loader["installPath"]]) - # The file specified in grubCfg should already be filled out - # by the grubcfg job module. + # The input file /etc/default/grub should already be filled out by the + # grubcfg job module. check_target_env_call([libcalamares.job.configuration["grubMkconfig"], "-o", libcalamares.job.configuration["grubCfg"]]) @@ -395,6 +395,12 @@ def install_secureboot(efi_directory): "-p", efi_partition_number, "-l", install_efi_directory + "/" + install_efi_bin]) + # The input file /etc/default/grub should already be filled out by the + # grubcfg job module. + check_target_env_call([libcalamares.job.configuration["grubMkconfig"], + "-o", os.path.join(efi_directory, "EFI", + efi_bootloader_id, "grub.cfg")]) + def vfat_correct_case(parent, name): for candidate in os.listdir(parent):