Only write rd.luks.uuid if dracut is present and leave other initramfs generators clean (#266)

* add rd.luks.uuid to GRUB_CMDLINE (fixes unbootable system with dracut --nohostonly, and doesn't affect any other initramfs generators)

* typo

* only write rd.luks.uuid line if dracut is present, and leave other initramfs generators alone :D

* add missing = operator
main
V3n3RiX 8 years ago committed by Teo Mrnjavac
parent 7d46109cc2
commit 0bde162a9c

@ -34,6 +34,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
default_dir = os.path.join(root_mount_point, "etc/default")
default_grub = os.path.join(default_dir, "grub")
distributor_replace = distributor.replace("'", "'\\''")
dracut_bin = libcalamares.utils.target_env_call(["sh", "-c", "which dracut"])
use_splash = ""
swap_uuid = ""
@ -43,17 +44,23 @@ def modify_grub_default(partitions, root_mount_point, distributor):
cryptdevice_params = []
for partition in partitions:
if partition["fs"] == "linuxswap":
swap_uuid = partition["uuid"]
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
cryptdevice_params = [
"cryptdevice=UUID={!s}:{!s}".format(partition["luksUuid"],
partition["luksMapperName"]),
"root=/dev/mapper/{!s}".format(partition["luksMapperName"]),
# Fix for unbootable system with dracut --nohostonly
"rd.luks.uuid={!s}".format(partition["luksUuid"])
if dracut_bin == 0:
for partition in partitions:
if partition["fs"] == "linuxswap":
swap_uuid = partition["uuid"]
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
cryptdevice_params = ["rd.luks.uuid={!s}".format(partition["luksUuid"])]
else:
for partition in partitions:
if partition["fs"] == "linuxswap":
swap_uuid = partition["uuid"]
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
cryptdevice_params = [
"cryptdevice=UUID={!s}:{!s}".format(partition["luksUuid"],
partition["luksMapperName"]),
"root=/dev/mapper/{!s}".format(partition["luksMapperName"])
]
kernel_params = ["quiet"]

Loading…
Cancel
Save