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
This commit is contained in:
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_dir = os.path.join(root_mount_point, "etc/default")
|
||||||
default_grub = os.path.join(default_dir, "grub")
|
default_grub = os.path.join(default_dir, "grub")
|
||||||
distributor_replace = distributor.replace("'", "'\\''")
|
distributor_replace = distributor.replace("'", "'\\''")
|
||||||
|
dracut_bin = libcalamares.utils.target_env_call(["sh", "-c", "which dracut"])
|
||||||
use_splash = ""
|
use_splash = ""
|
||||||
swap_uuid = ""
|
swap_uuid = ""
|
||||||
|
|
||||||
@ -43,6 +44,14 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
|
|
||||||
cryptdevice_params = []
|
cryptdevice_params = []
|
||||||
|
|
||||||
|
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:
|
for partition in partitions:
|
||||||
if partition["fs"] == "linuxswap":
|
if partition["fs"] == "linuxswap":
|
||||||
swap_uuid = partition["uuid"]
|
swap_uuid = partition["uuid"]
|
||||||
@ -51,9 +60,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
cryptdevice_params = [
|
cryptdevice_params = [
|
||||||
"cryptdevice=UUID={!s}:{!s}".format(partition["luksUuid"],
|
"cryptdevice=UUID={!s}:{!s}".format(partition["luksUuid"],
|
||||||
partition["luksMapperName"]),
|
partition["luksMapperName"]),
|
||||||
"root=/dev/mapper/{!s}".format(partition["luksMapperName"]),
|
"root=/dev/mapper/{!s}".format(partition["luksMapperName"])
|
||||||
# Fix for unbootable system with dracut --nohostonly
|
|
||||||
"rd.luks.uuid={!s}".format(partition["luksUuid"])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
kernel_params = ["quiet"]
|
kernel_params = ["quiet"]
|
||||||
|
Loading…
Reference in New Issue
Block a user