dracut : unlock encrypted swap if exists (#267)

* dracut : unlock encrypted swap if exists
* only check for swap_outer_uuid if dracut exists
main
V3n3RiX 8 years ago committed by Teo Mrnjavac
parent 0bde162a9c
commit 11c9e87fd0

@ -37,6 +37,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
dracut_bin = libcalamares.utils.target_env_call(["sh", "-c", "which dracut"])
use_splash = ""
swap_uuid = ""
swap_outer_uuid = ""
if libcalamares.globalstorage.contains("hasPlymouth"):
if libcalamares.globalstorage.value("hasPlymouth"):
@ -44,11 +45,14 @@ def modify_grub_default(partitions, root_mount_point, distributor):
cryptdevice_params = []
if dracut_bin == 0:
if dracut_bin == "0":
for partition in partitions:
if partition["fs"] == "linuxswap":
swap_uuid = partition["uuid"]
if partition["fs"] == "linuxswap" and "luksMapperName" in partition:
swap_outer_uuid = partition["luksUuid"]
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
cryptdevice_params = ["rd.luks.uuid={!s}".format(partition["luksUuid"])]
else:
@ -74,6 +78,9 @@ def modify_grub_default(partitions, root_mount_point, distributor):
if swap_uuid:
kernel_params.append("resume=UUID={!s}".format(swap_uuid))
if dracut_bin == "0" and swap_outer_uuid:
kernel_params.append("rd.luks.uuid={!s}".format(swap_outer_uuid))
distributor_line = "GRUB_DISTRIBUTOR='{!s}'".format(distributor_replace)
if not os.path.exists(default_dir):

Loading…
Cancel
Save