Added the necessary edits

This commit is contained in:
Boria138 2023-08-17 21:14:47 +06:00
parent 543de65f33
commit 7d6a04d3a8
2 changed files with 4 additions and 7 deletions

View File

@ -137,6 +137,7 @@ def get_kernel_params(uuid):
cryptdevice_params = []
have_dracut = libcalamares.utils.target_env_call(["sh", "-c", "which dracut"]) == 0
uses_sd-encrypt = libcalamares.utils.target_env_call(["sh", "-c", "grep -q 'sd-encrypt' /etc/mkinitcpio.conf"])
# Take over swap settings:
# - unencrypted swap partition sets swap_uuid
@ -154,7 +155,7 @@ def get_kernel_params(uuid):
swap_outer_uuid = partition["luksUuid"]
if partition["mountPoint"] == "/" and has_luks:
if have_dracut:
if have_dracut or uses_sd-encrypt:
cryptdevice_params = [f"rd.luks.uuid={partition['luksUuid']}"]
else:
cryptdevice_params = [f"cryptdevice=UUID={partition['luksUuid']}:{partition['luksMapperName']}"]

View File

@ -141,7 +141,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
# Shell exit value 0 means success
have_plymouth = plymouth_bin == 0
have_dracut = dracut_bin == 0
have_systemd = mkinitcpio_systemd == 0
uses_sd-encrypt = mkinitcpio_systemd == 0
use_splash = ""
swap_uuid = ""
@ -162,7 +162,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
cryptdevice_params = []
if have_dracut:
if have_dracut or used_sd-encrypt:
for partition in partitions:
if partition["fs"] == "linuxswap" and not partition.get("claimed", None):
# Skip foreign swap
@ -218,10 +218,6 @@ def modify_grub_default(partitions, root_mount_point, distributor):
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)
grub_config_items = {}