Don't enable grub password query if /boot is on unencrypted partition

main
Chrysostomus 4 years ago
parent 84558333bf
commit 3eae98eac3

@ -90,6 +90,12 @@ def modify_grub_default(partitions, root_mount_point, distributor):
swap_outer_uuid = ""
swap_outer_mappername = None
no_save_default = False
unencrypted_separate_boot = False
for partition in partitions:
if (partition["mountPoint"] == "/boot"
and "luksMapperName" not in partition):
unencrypted_separate_boot = True
for partition in partitions:
if partition["mountPoint"] in ("/", "/boot") and partition["fs"] in ("btrfs", "f2fs"):
@ -239,7 +245,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
if not have_distributor_line:
lines.append(distributor_line)
if cryptdevice_params:
if cryptdevice_params and not unencrypted_separate_boot:
lines.append("GRUB_ENABLE_CRYPTODISK=y")
with open(default_grub, 'w') as grub_file:

Loading…
Cancel
Save