dracut : unlock encrypted swap if exists (#267)
* dracut : unlock encrypted swap if exists * only check for swap_outer_uuid if dracut exists
This commit is contained in:
parent
e0dc6e03fd
commit
a279eaf4fa
@ -37,6 +37,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
dracut_bin = libcalamares.utils.target_env_call(["sh", "-c", "which dracut"])
|
dracut_bin = libcalamares.utils.target_env_call(["sh", "-c", "which dracut"])
|
||||||
use_splash = ""
|
use_splash = ""
|
||||||
swap_uuid = ""
|
swap_uuid = ""
|
||||||
|
swap_outer_uuid = ""
|
||||||
|
|
||||||
if libcalamares.globalstorage.contains("hasPlymouth"):
|
if libcalamares.globalstorage.contains("hasPlymouth"):
|
||||||
if libcalamares.globalstorage.value("hasPlymouth"):
|
if libcalamares.globalstorage.value("hasPlymouth"):
|
||||||
@ -44,11 +45,14 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
|
|
||||||
cryptdevice_params = []
|
cryptdevice_params = []
|
||||||
|
|
||||||
if dracut_bin == 0:
|
if dracut_bin == "0":
|
||||||
for partition in partitions:
|
for partition in partitions:
|
||||||
if partition["fs"] == "linuxswap":
|
if partition["fs"] == "linuxswap":
|
||||||
swap_uuid = partition["uuid"]
|
swap_uuid = partition["uuid"]
|
||||||
|
|
||||||
|
if partition["fs"] == "linuxswap" and "luksMapperName" in partition:
|
||||||
|
swap_outer_uuid = partition["luksUuid"]
|
||||||
|
|
||||||
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
|
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
|
||||||
cryptdevice_params = ["rd.luks.uuid={!s}".format(partition["luksUuid"])]
|
cryptdevice_params = ["rd.luks.uuid={!s}".format(partition["luksUuid"])]
|
||||||
else:
|
else:
|
||||||
@ -74,6 +78,9 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
if swap_uuid:
|
if swap_uuid:
|
||||||
kernel_params.append("resume=UUID={!s}".format(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)
|
distributor_line = "GRUB_DISTRIBUTOR='{!s}'".format(distributor_replace)
|
||||||
|
|
||||||
if not os.path.exists(default_dir):
|
if not os.path.exists(default_dir):
|
||||||
|
Loading…
Reference in New Issue
Block a user