diff --git a/src/modules/bootloader/bootloader.conf b/src/modules/bootloader/bootloader.conf index af79d1bb9..8a102c68c 100644 --- a/src/modules/bootloader/bootloader.conf +++ b/src/modules/bootloader/bootloader.conf @@ -1,6 +1,9 @@ --- # Gummiboot configuration files settings, set kernel and initramfs file names # and amount of time before default selection boots +# Optionally set the menu entry name to use in Gummiboot. If not specified here, +# this setting will be taken from branding.desc. +# bootloaderEntryName: KaOS-kf5 kernel: /vmlinuz-linux img: /initramfs-linux.img fallback: /initramfs-linux-fallback.img diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index cd9dc86e4..f30a9857d 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -52,9 +52,15 @@ def get_uuid(): return "" +def get_bootloader_entry_name(): + if "bootloaderEntryName" in libcalamares.job.configuration: + return libcalamares.job.configuration["bootloaderEntryName"] + else: + branding = libcalamares.globalstorage.value("branding") + return branding["bootloaderEntryName"] + def create_conf(uuid, conf_path): - branding = libcalamares.globalstorage.value("branding") - distribution = branding["bootloaderEntryName"] + distribution = get_bootloader_entry_name() kernel = libcalamares.job.configuration["kernel"] img = libcalamares.job.configuration["img"] partitions = libcalamares.globalstorage.value("partitions") @@ -80,8 +86,7 @@ def create_conf(uuid, conf_path): def create_fallback(uuid, fallback_path): - branding = libcalamares.globalstorage.value("branding") - distribution = branding["bootloaderEntryName"] + distribution = get_bootloader_entry_name() kernel = libcalamares.job.configuration["kernel"] fb_img = libcalamares.job.configuration["fallback"] partitions = libcalamares.globalstorage.value("partitions") @@ -107,8 +112,7 @@ def create_fallback(uuid, fallback_path): def create_loader(loader_path): - branding = libcalamares.globalstorage.value("branding") - distribution = branding["bootloaderEntryName"] + distribution = get_bootloader_entry_name() timeout = libcalamares.job.configuration["timeout"] file_name_sanitizer = str.maketrans(" /", "_-") lines = [ @@ -126,8 +130,7 @@ def install_bootloader(boot_loader, fw_type): if fw_type == 'efi': install_path = libcalamares.globalstorage.value("rootMountPoint") uuid = get_uuid() - branding = libcalamares.globalstorage.value("branding") - distribution = branding["bootloaderEntryName"] + distribution = get_bootloader_entry_name() file_name_sanitizer = str.maketrans(" /", "_-") conf_path = os.path.join( install_path, "boot", "loader", "entries", "%s.conf" % distribution.translate(file_name_sanitizer))