diff --git a/src/modules/grub/grub.conf b/src/modules/grub/grub.conf index 0f84abf75..ffef6f62e 100644 --- a/src/modules/grub/grub.conf +++ b/src/modules/grub/grub.conf @@ -4,3 +4,8 @@ grubInstall: "grub-install" grubMkconfig: "grub-mkconfig" grubCfg: "/boot/grub/grub.cfg" +# Optionally set the --bootloader-id to use for EFI. If not set, this defaults +# to the bootloaderEntryName from branding.desc with problematic characters +# replaced. If an efiBootloaderId is specified here, it is taken to already be a +# valid directory name, so no such postprocessing is done in this case. +# efiBootloaderId: "dirname" diff --git a/src/modules/grub/main.py b/src/modules/grub/main.py index 7ee457610..e97e56874 100644 --- a/src/modules/grub/main.py +++ b/src/modules/grub/main.py @@ -26,10 +26,14 @@ from libcalamares.utils import check_chroot_call def install_grub(boot_loader, fw_type): if fw_type == 'efi': efi_directory = "/boot/efi" - branding = libcalamares.globalstorage.value("branding") - distribution = branding["bootloaderEntryName"] - file_name_sanitizer = str.maketrans(" /", "_-") - check_chroot_call([libcalamares.job.configuration["grubInstall"], "--target=x86_64-efi", "--efi-directory={!s}".format(efi_directory), "--bootloader-id={!s}".format(distribution.translate(file_name_sanitizer))]) + if "efiBootloaderId" in libcalamares.job.configuration: + efi_bootloader_id = libcalamares.job.configuration["efiBootloaderId"] + else: + branding = libcalamares.globalstorage.value("branding") + distribution = branding["bootloaderEntryName"] + file_name_sanitizer = str.maketrans(" /", "_-") + efi_bootloader_id = distribution.translate(file_name_sanitizer) + check_chroot_call([libcalamares.job.configuration["grubInstall"], "--target=x86_64-efi", "--efi-directory={!s}".format(efi_directory), "--bootloader-id={!s}".format(efi_bootloader_id)]) else: install_path = boot_loader["installPath"] check_chroot_call([libcalamares.job.configuration["grubInstall"], install_path])