From 3552691e57eed06b7ef939c6e5bd5d72d972919e Mon Sep 17 00:00:00 2001 From: dalto Date: Sat, 26 Aug 2023 11:22:41 -0500 Subject: [PATCH] [grubcfg] Add rd.luks.key for systemd-encrypt hook --- src/modules/grubcfg/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index 1d7cb0077..82b1837f8 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -137,10 +137,10 @@ def modify_grub_default(partitions, root_mount_point, distributor): ) uses_systemd_hook = libcalamares.utils.target_env_call( ["sh", "-c", "grep -q \"^HOOKS.*systemd\" /etc/mkinitcpio.conf"] - ) + ) == 0 # Shell exit value 0 means success have_plymouth = plymouth_bin == 0 - use_systemd_naming = dracut_bin == 0 or uses_systemd_hook == 0 + use_systemd_naming = dracut_bin == 0 or uses_systemd_hook use_splash = "" swap_uuid = "" @@ -176,6 +176,8 @@ def modify_grub_default(partitions, root_mount_point, distributor): if partition["mountPoint"] == "/" and has_luks: cryptdevice_params = [f"rd.luks.uuid={partition['luksUuid']}"] + if not unencrypted_separate_boot and uses_systemd_hook: + cryptdevice_params.append("rd.luks.key=/crypto_keyfile.bin") else: for partition in partitions: if partition["fs"] == "linuxswap" and not partition.get("claimed", None):