From 04e927e67f6f4dca0b7506d131ac5156904487e5 Mon Sep 17 00:00:00 2001 From: dalto Date: Sun, 21 Feb 2021 17:27:46 -0600 Subject: [PATCH 1/5] EndeavourOS customizations --- src/modules/bootloader/bootloader.conf | 16 +- src/modules/bootloader/bootloader.schema.yaml | 10 +- src/modules/bootloader/main.py | 176 +++++++++++------- 3 files changed, 126 insertions(+), 76 deletions(-) diff --git a/src/modules/bootloader/bootloader.conf b/src/modules/bootloader/bootloader.conf index f471c2ee0..a8a82c368 100644 --- a/src/modules/bootloader/bootloader.conf +++ b/src/modules/bootloader/bootloader.conf @@ -7,21 +7,21 @@ --- # Define which bootloader you want to use for EFI installations # Possible options are 'grub', 'sb-shim' and 'systemd-boot'. -efiBootLoader: "grub" +efiBootLoader: "systemd-boot" -# systemd-boot configuration files settings, set kernel and initramfs file names +# systemd-boot configuration files settings, set kernel search path, kernel name # and amount of time before default selection boots -kernel: "/vmlinuz-linux" -img: "/initramfs-linux.img" -fallback: "/initramfs-linux-fallback.img" +kernelSearchPath: "/usr/lib/modules" +kernelName: "vmlinuz" timeout: "10" -# Optionally set the menu entry name and kernel name to use in systemd-boot. +# additionalInitrdFiles is a comma seperated list of file names +additionalInitrdFiles: "/boot/amd-ucode,/boot/intel-ucode" + +# Optionally set the menu entry name to use in systemd-boot. # If not specified here, these settings will be taken from branding.desc. # # bootloaderEntryName: "Generic GNU/Linux" -# kernelLine: ", with Stable-Kernel" -# fallbackKernelLine: ", with Stable-Kernel (fallback initramfs)" # GRUB 2 binary names and boot directory # Some distributions (e.g. Fedora) use grub2-* (resp. /boot/grub2/) names. diff --git a/src/modules/bootloader/bootloader.schema.yaml b/src/modules/bootloader/bootloader.schema.yaml index 152d3ab72..4554cbf73 100644 --- a/src/modules/bootloader/bootloader.schema.yaml +++ b/src/modules/bootloader/bootloader.schema.yaml @@ -7,10 +7,10 @@ additionalProperties: false type: object properties: efiBootLoader: { type: string } - kernel: { type: string } - img: { type: string } - fallback: { type: string } + kernelSearchPath: { type: string } + kernelName: { type: string } timeout: { type: string } # Inserted verbatim + additionalInitrdFiles: { type: string } bootloaderEntryName: { type: string } kernelLine: { type: string } fallbackKernelLine: { type: string } @@ -27,8 +27,8 @@ properties: required: - efiBootLoader - - kernel - - img + - kernelSearchPath + - kernelName - grubInstall - grubMkconfig - grubCfg diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 68cbddd0e..e42f33b3e 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -73,26 +73,7 @@ def get_bootloader_entry_name(): return branding["bootloaderEntryName"] -def get_kernel_line(kernel_type): - """ - Passes 'kernel_line' to other routine based on configuration file. - - :param kernel_type: - :return: - """ - if kernel_type == "fallback": - if "fallbackKernelLine" in libcalamares.job.configuration: - return libcalamares.job.configuration["fallbackKernelLine"] - else: - return " (fallback)" - else: - if "kernelLine" in libcalamares.job.configuration: - return libcalamares.job.configuration["kernelLine"] - else: - return "" - - -def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, kernel_type): +def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, kernel, kernel_type, kernel_version): """ Creates systemd-boot configuration files based on given parameters. @@ -101,9 +82,10 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker :param uuid: :param entry: :param entry_name: + :param kernel: :param kernel_type: + :param kernel_version: """ - kernel = libcalamares.job.configuration["kernel"] kernel_params = ["quiet"] partitions = libcalamares.globalstorage.value("partitions") @@ -151,43 +133,84 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker kernel_params.append("resume=/dev/mapper/{!s}".format( swap_outer_mappername)) - kernel_line = get_kernel_line(kernel_type) + kernel_line = entry_name + " " + kernel_version libcalamares.utils.debug("Configure: \"{!s}\"".format(kernel_line)) if kernel_type == "fallback": - img = libcalamares.job.configuration["fallback"] - entry_name = entry_name + "-fallback" + version_string = kernel_version + "-fallback" + initrd = "initrd-fallback" + mkinitcpio_option = "-S autodetect" else: - img = libcalamares.job.configuration["img"] + version_string = kernel_version + initrd = "initrd" + mkinitcpio_option = "" + + # get the machine-id + with open(os.path.join(install_path, "etc", "machine-id"), 'r') as machineid_file: + machine_id = machineid_file.read().rstrip('\n') + + # Copy kernel to a subdirectory of /efi partition + machine_dir = os.path.join(install_path + efi_dir, machine_id) + try: + os.mkdir(machine_dir) + except FileExistsError: # We can ignore errors caused by the directory existing already + pass + + files_dir = os.path.join(machine_dir, kernel_version) + try: + os.mkdir(files_dir) + except FileExistsError: # We can ignore errors caused by the directory existing already + pass + + kernel_path = os.path.join(install_path, kernel) + kernel_name = os.path.basename(kernel_path) + shutil.copyfile(kernel_path, os.path.join(files_dir, "linux")) + + # generate the initramfs - this is Arch specific and should be replaced for other distros + try: + subprocess.run(["chroot " + + install_path + + " mkinitcpio -k " + kernel_version + " -g " + os.path.join("/", os.path.relpath(files_dir, install_path), initrd)], + shell=True, + capture_output=True, + check=True) + except subprocess.CalledProcessError as cpe: + libcalamares.utils.debug("mkiniticpio failed") + libcalamares.utils.debug("STDOUT: " + cpe.stdout.decode()) + libcalamares.utils.debug("STDERR: " + cpe.stderr.decode()) + raise + + + # write the entry + lines = [ + '## Generated by Calamares\n', + '\n', + "title {!s}\n".format(entry), + "version {!s}\n".format(version_string), + "machine-id {!s}\n".format(machine_id), + "linux {!s}\n".format(os.path.join("/", machine_id, kernel_version, "linux")), + ] + + try: + additional_initrd_files = libcalamares.job.configuration["additionalInitrdFiles"] + for initrd_file in additional_initrd_files.split(','): + libcalamares.utils.debug("Attempting to handle initrd image " + initrd_file) + if os.path.isfile(os.path.join(install_path, initrd_file)): + libcalamares.utils.debug("Found image " + initrd_file) + shutil.copyfile(os.path.join(install_path, initrd_file), os.path.join(files_dir, os.path.basename(initrd_file))) + lines.append("initrd {!s}\n".format(os.path.join("/", machine_id, kernel_version, os.path.basename(initrd_file)))) + except KeyError: # If the configuration option isn't set, we can just move on + libcalamares.utils.debug("Failed to find key additionalInitrdFiles") + pass + + lines.append("initrd {!s}\n".format(os.path.join("/", machine_id, kernel_version, initrd))) + lines.append("options {!s} rw\n".format(" ".join(kernel_params))) conf_path = os.path.join(install_path + efi_dir, "loader", "entries", - entry_name + ".conf") - - # Copy kernel and initramfs to a subdirectory of /efi partition - files_dir = os.path.join(install_path + efi_dir, entry_name) - os.mkdir(files_dir) - - kernel_path = install_path + kernel - kernel_name = os.path.basename(kernel_path) - shutil.copyfile(kernel_path, os.path.join(files_dir, kernel_name)) - - img_path = install_path + img - img_name = os.path.basename(img_path) - shutil.copyfile(img_path, os.path.join(files_dir, img_name)) - - lines = [ - '## This is just an example config file.\n', - '## Please edit the paths and kernel parameters according\n', - '## to your system.\n', - '\n', - "title {!s}{!s}\n".format(entry, kernel_line), - "linux {!s}\n".format(os.path.join("/", entry_name, kernel_name)), - "initrd {!s}\n".format(os.path.join("/", entry_name, img_name)), - "options {!s} rw\n".format(" ".join(kernel_params)), - ] - + machine_id + "-" + version_string + ".conf") + with open(conf_path, 'w') as conf_file: for line in lines: conf_file.write(line) @@ -261,6 +284,8 @@ def install_systemd_boot(efi_directory): """ libcalamares.utils.debug("Bootloader: systemd-boot") install_path = libcalamares.globalstorage.value("rootMountPoint") + kernel_search_path = libcalamares.job.configuration["kernelSearchPath"] + source_kernel_name = libcalamares.job.configuration["kernelName"] install_efi_directory = install_path + efi_directory uuid = get_uuid() distribution = get_bootloader_entry_name() @@ -271,21 +296,46 @@ def install_systemd_boot(efi_directory): subprocess.call(["bootctl", "--path={!s}".format(install_efi_directory), "install"]) - create_systemd_boot_conf(install_path, - efi_directory, - uuid, - distribution, - distribution_translated, - "default") - if "fallback" in libcalamares.job.configuration: - create_systemd_boot_conf(install_path, - efi_directory, - uuid, - distribution, - distribution_translated, - "fallback") + + # find all the installed kernels and generate default and fallback entries for each + # This is Arch-specific and may need adjustment for other distros + for root, dirs, files in os.walk(os.path.join(install_path, kernel_search_path)): + for file in files: + if file == source_kernel_name: + rel_root = os.path.relpath(root, install_path) + create_systemd_boot_conf(install_path, + efi_directory, + uuid, + distribution, + distribution_translated, + os.path.join(rel_root, file), + "default", + os.path.basename(root)) + create_systemd_boot_conf(install_path, + efi_directory, + uuid, + distribution, + distribution_translated, + os.path.join(rel_root, file), + "fallback", + os.path.basename(root)) + create_loader(loader_path, distribution_translated) + # clean up redundant kernel and initrd + try: + os.remove(os.path.join(install_path, "boot/vmlinuz-linux")) + except FileNotFoundError: + pass + try: + os.remove(os.path.join(install_path, "boot/initramfs-linux.img")) + except FileNotFoundError: + pass + try: + os.remove(os.path.join(install_path, "boot/initramfs-linux-fallback.img")) + except FileNotFoundError: + pass + def get_grub_efi_parameters(): """ From e0f40cb4a4b7691ebb54092adb2ccced6c2f59a7 Mon Sep 17 00:00:00 2001 From: dalto Date: Sun, 21 Feb 2021 17:36:11 -0600 Subject: [PATCH 2/5] Remove EOS-specific changes --- src/modules/bootloader/bootloader.conf | 2 +- src/modules/bootloader/main.py | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/modules/bootloader/bootloader.conf b/src/modules/bootloader/bootloader.conf index a8a82c368..278c345ad 100644 --- a/src/modules/bootloader/bootloader.conf +++ b/src/modules/bootloader/bootloader.conf @@ -7,7 +7,7 @@ --- # Define which bootloader you want to use for EFI installations # Possible options are 'grub', 'sb-shim' and 'systemd-boot'. -efiBootLoader: "systemd-boot" +efiBootLoader: "grub" # systemd-boot configuration files settings, set kernel search path, kernel name # and amount of time before default selection boots diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index e42f33b3e..ba61cc665 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -322,20 +322,6 @@ def install_systemd_boot(efi_directory): create_loader(loader_path, distribution_translated) - # clean up redundant kernel and initrd - try: - os.remove(os.path.join(install_path, "boot/vmlinuz-linux")) - except FileNotFoundError: - pass - try: - os.remove(os.path.join(install_path, "boot/initramfs-linux.img")) - except FileNotFoundError: - pass - try: - os.remove(os.path.join(install_path, "boot/initramfs-linux-fallback.img")) - except FileNotFoundError: - pass - def get_grub_efi_parameters(): """ From c1f7a2c8553f177b0ce1728b2d04ce1d1579197c Mon Sep 17 00:00:00 2001 From: dalto Date: Wed, 24 Feb 2021 09:41:42 -0600 Subject: [PATCH 3/5] Fix issue with absolute paths --- src/modules/bootloader/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index ba61cc665..867764558 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -299,7 +299,7 @@ def install_systemd_boot(efi_directory): # find all the installed kernels and generate default and fallback entries for each # This is Arch-specific and may need adjustment for other distros - for root, dirs, files in os.walk(os.path.join(install_path, kernel_search_path)): + for root, dirs, files in os.walk(os.path.join(install_path, kernel_search_path.lstrip('/'))): for file in files: if file == source_kernel_name: rel_root = os.path.relpath(root, install_path) From 9d9cd44617495bd1499ecddbeb1710ba791e288b Mon Sep 17 00:00:00 2001 From: dalto Date: Sun, 19 Sep 2021 19:23:56 -0500 Subject: [PATCH 4/5] Changes from review comments --- src/modules/bootloader/bootloader.schema.yaml | 1 + src/modules/bootloader/main.py | 132 ++++++++---------- 2 files changed, 58 insertions(+), 75 deletions(-) diff --git a/src/modules/bootloader/bootloader.schema.yaml b/src/modules/bootloader/bootloader.schema.yaml index 4554cbf73..914a17c27 100644 --- a/src/modules/bootloader/bootloader.schema.yaml +++ b/src/modules/bootloader/bootloader.schema.yaml @@ -33,3 +33,4 @@ required: - grubMkconfig - grubCfg - grubProbe + - machineid diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 867764558..7c5007050 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -73,18 +73,17 @@ def get_bootloader_entry_name(): return branding["bootloaderEntryName"] -def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, kernel, kernel_type, kernel_version): +def create_systemd_boot_conf(installation_root_path, efi_dir, uuid, entry, kernel, kernel_type, kernel_version): """ Creates systemd-boot configuration files based on given parameters. - :param install_path: - :param efi_dir: - :param uuid: - :param entry: - :param entry_name: - :param kernel: - :param kernel_type: - :param kernel_version: + :param installation_root_path: A string containing the absolute path to the root of the installation + :param efi_dir: A string containing the path to the efi dir relative to the root of the installation + :param uuid: A string containing the UUID of the root volume + :param entry: A string containing the name of the entry as it will be displayed on boot + :param kernel: A string containing the path to the kernel relative to the root of the installation + :param kernel_type: A string which should be set if there is a special version of the entry, for example "fallback" + :param kernel_version: The kernel version string """ kernel_params = ["quiet"] @@ -133,53 +132,29 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker kernel_params.append("resume=/dev/mapper/{!s}".format( swap_outer_mappername)) - kernel_line = entry_name + " " + kernel_version - libcalamares.utils.debug("Configure: \"{!s}\"".format(kernel_line)) + libcalamares.utils.debug("Configure: \"{!s}\"".format(f"{entry} {kernel_version}")) if kernel_type == "fallback": version_string = kernel_version + "-fallback" initrd = "initrd-fallback" - mkinitcpio_option = "-S autodetect" else: version_string = kernel_version initrd = "initrd" - mkinitcpio_option = "" # get the machine-id - with open(os.path.join(install_path, "etc", "machine-id"), 'r') as machineid_file: + with open(os.path.join(installation_root_path, "etc", "machine-id"), 'r') as machineid_file: machine_id = machineid_file.read().rstrip('\n') # Copy kernel to a subdirectory of /efi partition - machine_dir = os.path.join(install_path + efi_dir, machine_id) - try: - os.mkdir(machine_dir) - except FileExistsError: # We can ignore errors caused by the directory existing already - pass + machine_dir = os.path.join(installation_root_path + efi_dir, machine_id) + os.makedirs(machine_dir, exist_ok=True) - files_dir = os.path.join(machine_dir, kernel_version) - try: - os.mkdir(files_dir) - except FileExistsError: # We can ignore errors caused by the directory existing already - pass + target_efi_files_dir = os.path.join(machine_dir, kernel_version) + os.makedirs(target_efi_files_dir, exist_ok=True) - kernel_path = os.path.join(install_path, kernel) + kernel_path = os.path.join(installation_root_path, kernel) kernel_name = os.path.basename(kernel_path) - shutil.copyfile(kernel_path, os.path.join(files_dir, "linux")) - - # generate the initramfs - this is Arch specific and should be replaced for other distros - try: - subprocess.run(["chroot " + - install_path + - " mkinitcpio -k " + kernel_version + " -g " + os.path.join("/", os.path.relpath(files_dir, install_path), initrd)], - shell=True, - capture_output=True, - check=True) - except subprocess.CalledProcessError as cpe: - libcalamares.utils.debug("mkiniticpio failed") - libcalamares.utils.debug("STDOUT: " + cpe.stdout.decode()) - libcalamares.utils.debug("STDERR: " + cpe.stderr.decode()) - raise - + shutil.copyfile(kernel_path, os.path.join(target_efi_files_dir, "linux")) # write the entry lines = [ @@ -195,9 +170,9 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker additional_initrd_files = libcalamares.job.configuration["additionalInitrdFiles"] for initrd_file in additional_initrd_files.split(','): libcalamares.utils.debug("Attempting to handle initrd image " + initrd_file) - if os.path.isfile(os.path.join(install_path, initrd_file)): + if os.path.isfile(os.path.join(installation_root_path, initrd_file.lstrip('/'))): libcalamares.utils.debug("Found image " + initrd_file) - shutil.copyfile(os.path.join(install_path, initrd_file), os.path.join(files_dir, os.path.basename(initrd_file))) + shutil.copyfile(os.path.join(installation_root_path, initrd_file.lstrip('/')), os.path.join(target_efi_files_dir, os.path.basename(initrd_file))) lines.append("initrd {!s}\n".format(os.path.join("/", machine_id, kernel_version, os.path.basename(initrd_file)))) except KeyError: # If the configuration option isn't set, we can just move on libcalamares.utils.debug("Failed to find key additionalInitrdFiles") @@ -206,7 +181,7 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker lines.append("initrd {!s}\n".format(os.path.join("/", machine_id, kernel_version, initrd))) lines.append("options {!s} rw\n".format(" ".join(kernel_params))) - conf_path = os.path.join(install_path + efi_dir, + conf_path = os.path.join(installation_root_path + efi_dir, "loader", "entries", machine_id + "-" + version_string + ".conf") @@ -275,6 +250,30 @@ def efi_boot_next(): if boot_entry: subprocess.call([boot_mgr, "-n", boot_entry]) +def get_kernels(installation_root_path): + """ + Gets a list of kernels and associated values for each kernel. This will work as is for many distros. + If not, it should be safe to modify it to better support your distro + + :param installation_root_path: A string with the absolute path to the root of the installation + + Returns a list of 3-tuples + + Each 3-tuple contains the kernel, kernel_type and kernel_version + """ + kernel_search_path = libcalamares.job.configuration["kernelSearchPath"] + source_kernel_name = libcalamares.job.configuration["kernelName"] + kernel_list = [] + + # find all the installed kernels and generate default and fallback entries for each + for root, dirs, files in os.walk(os.path.join(installation_root_path, kernel_search_path.lstrip('/'))): + for file in files: + if file == source_kernel_name: + rel_root = os.path.relpath(root, installation_root_path) + kernel_list.append((os.path.join(rel_root, file),"default",os.path.basename(root))) + kernel_list.append((os.path.join(rel_root, file),"fallback",os.path.basename(root))) + + return kernel_list def install_systemd_boot(efi_directory): """ @@ -283,10 +282,8 @@ def install_systemd_boot(efi_directory): :param efi_directory: """ libcalamares.utils.debug("Bootloader: systemd-boot") - install_path = libcalamares.globalstorage.value("rootMountPoint") - kernel_search_path = libcalamares.job.configuration["kernelSearchPath"] - source_kernel_name = libcalamares.job.configuration["kernelName"] - install_efi_directory = install_path + efi_directory + installation_root_path = libcalamares.globalstorage.value("rootMountPoint") + install_efi_directory = installation_root_path + efi_directory uuid = get_uuid() distribution = get_bootloader_entry_name() distribution_translated = distribution.translate(file_name_sanitizer) @@ -297,32 +294,17 @@ def install_systemd_boot(efi_directory): "--path={!s}".format(install_efi_directory), "install"]) - # find all the installed kernels and generate default and fallback entries for each - # This is Arch-specific and may need adjustment for other distros - for root, dirs, files in os.walk(os.path.join(install_path, kernel_search_path.lstrip('/'))): - for file in files: - if file == source_kernel_name: - rel_root = os.path.relpath(root, install_path) - create_systemd_boot_conf(install_path, - efi_directory, - uuid, - distribution, - distribution_translated, - os.path.join(rel_root, file), - "default", - os.path.basename(root)) - create_systemd_boot_conf(install_path, - efi_directory, - uuid, - distribution, - distribution_translated, - os.path.join(rel_root, file), - "fallback", - os.path.basename(root)) + for (kernel, kernel_type, kernel_version) in get_kernels(installation_root_path): + create_systemd_boot_conf(installation_root_path, + efi_directory, + uuid, + distribution, + kernel, + kernel_type, + kernel_version) create_loader(loader_path, distribution_translated) - def get_grub_efi_parameters(): """ Returns a 3-tuple of suitable parameters for GRUB EFI installation, @@ -359,8 +341,8 @@ def install_grub(efi_directory, fw_type): """ if fw_type == "efi": libcalamares.utils.debug("Bootloader: grub (efi)") - install_path = libcalamares.globalstorage.value("rootMountPoint") - install_efi_directory = install_path + efi_directory + installation_root_path = libcalamares.globalstorage.value("rootMountPoint") + install_efi_directory = installation_root_path + efi_directory if not os.path.isdir(install_efi_directory): os.makedirs(install_efi_directory) @@ -430,8 +412,8 @@ def install_secureboot(efi_directory): """ efi_bootloader_id = efi_label() - install_path = libcalamares.globalstorage.value("rootMountPoint") - install_efi_directory = install_path + efi_directory + installation_root_path = libcalamares.globalstorage.value("rootMountPoint") + install_efi_directory = installation_root_path + efi_directory if efi_word_size() == "64": install_efi_bin = "shimx64.efi" From b5f8e30093879bec84b3cd0555e8b0f785f2d1db Mon Sep 17 00:00:00 2001 From: dalto Date: Wed, 13 Oct 2021 15:09:27 -0500 Subject: [PATCH 5/5] Change additionalInitrdFiles to an array --- src/modules/bootloader/bootloader.conf | 4 +++- src/modules/bootloader/bootloader.schema.yaml | 5 ++++- src/modules/bootloader/main.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/bootloader/bootloader.conf b/src/modules/bootloader/bootloader.conf index 278c345ad..60235e5d2 100644 --- a/src/modules/bootloader/bootloader.conf +++ b/src/modules/bootloader/bootloader.conf @@ -16,7 +16,9 @@ kernelName: "vmlinuz" timeout: "10" # additionalInitrdFiles is a comma seperated list of file names -additionalInitrdFiles: "/boot/amd-ucode,/boot/intel-ucode" +additionalInitrdFiles: + - "/boot/amd-ucode" + - "/boot/intel-ucode" # Optionally set the menu entry name to use in systemd-boot. # If not specified here, these settings will be taken from branding.desc. diff --git a/src/modules/bootloader/bootloader.schema.yaml b/src/modules/bootloader/bootloader.schema.yaml index 914a17c27..0849f6865 100644 --- a/src/modules/bootloader/bootloader.schema.yaml +++ b/src/modules/bootloader/bootloader.schema.yaml @@ -10,7 +10,10 @@ properties: kernelSearchPath: { type: string } kernelName: { type: string } timeout: { type: string } # Inserted verbatim - additionalInitrdFiles: { type: string } + additionalInitrdFiles: + type: array + items: + type: string bootloaderEntryName: { type: string } kernelLine: { type: string } fallbackKernelLine: { type: string } diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 7c5007050..bcb7f230a 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -168,7 +168,7 @@ def create_systemd_boot_conf(installation_root_path, efi_dir, uuid, entry, kerne try: additional_initrd_files = libcalamares.job.configuration["additionalInitrdFiles"] - for initrd_file in additional_initrd_files.split(','): + for initrd_file in additional_initrd_files: libcalamares.utils.debug("Attempting to handle initrd image " + initrd_file) if os.path.isfile(os.path.join(installation_root_path, initrd_file.lstrip('/'))): libcalamares.utils.debug("Found image " + initrd_file)