Added rd.luks.name to grubcfg

This commit is contained in:
Boria138 2023-08-17 13:04:24 +06:00
parent 5769c9c6da
commit 543de65f33

View File

@ -135,10 +135,13 @@ def modify_grub_default(partitions, root_mount_point, distributor):
plymouth_bin = libcalamares.utils.target_env_call(
["sh", "-c", "which plymouth"]
)
mkinitcpio_systemd = libcalamares.utils.target_env_call(
["sh", "-c", "grep -q 'sd-encrypt' /etc/mkinitcpio.conf"]
)
# Shell exit value 0 means success
have_plymouth = plymouth_bin == 0
have_dracut = dracut_bin == 0
have_systemd = mkinitcpio_systemd == 0
use_splash = ""
swap_uuid = ""
@ -214,6 +217,10 @@ def modify_grub_default(partitions, root_mount_point, distributor):
kernel_params.append(f"rd.luks.uuid={swap_outer_uuid}")
if swap_outer_mappername:
kernel_params.append(f"resume=/dev/mapper/{swap_outer_mappername}")
# When using rd.luks.name you can omit rd.luks.uuid
if have_systemd:
kernel_params.append(f"rd.luks.name={partition['luksUuid']}={partition['luksMapperName']}")
overwrite = libcalamares.job.configuration.get("overwrite", False)