Write the crypttab entry still

This commit is contained in:
Chrysostomus 2020-11-03 23:33:24 +02:00
parent 9f52282e4c
commit fe291bc51a

View File

@ -42,8 +42,7 @@ def write_dmcrypt_conf(partitions, root_mount_point, dmcrypt_conf_path):
if not has_luks and not skip_partitions: if not has_luks and not skip_partitions:
libcalamares.utils.debug( libcalamares.utils.debug(
"Skip writing OpenRC LUKS configuration for partition {!s}".format(partition["mountPoint"])) "Skip writing OpenRC LUKS configuration for partition {!s}".format(partition["mountPoint"]))
# Don't use keyfile if boot is unecrypted, keys must not be stored on unencrypted partitions if has_luks and not skip_partitions:
if has_luks and not skip_partitions and not unencrypted_separate_boot:
crypto_target = partition["luksMapperName"] crypto_target = partition["luksMapperName"]
crypto_source = "/dev/disk/by-uuid/{!s}".format(partition["uuid"]) crypto_source = "/dev/disk/by-uuid/{!s}".format(partition["uuid"])
libcalamares.utils.debug( libcalamares.utils.debug(
@ -52,7 +51,9 @@ def write_dmcrypt_conf(partitions, root_mount_point, dmcrypt_conf_path):
with open(os.path.join(root_mount_point, dmcrypt_conf_path), 'a+') as dmcrypt_file: with open(os.path.join(root_mount_point, dmcrypt_conf_path), 'a+') as dmcrypt_file:
dmcrypt_file.write("\ntarget=" + crypto_target) dmcrypt_file.write("\ntarget=" + crypto_target)
dmcrypt_file.write("\nsource=" + crypto_source) dmcrypt_file.write("\nsource=" + crypto_source)
dmcrypt_file.write("\nkey=/crypto_keyfile.bin") # Don't use keyfile if boot is unecrypted, keys must not be stored on unencrypted partitions
if not unencrypted_separate_boot:
dmcrypt_file.write("\nkey=/crypto_keyfile.bin")
dmcrypt_file.write("\n") dmcrypt_file.write("\n")
if has_luks and skip_partitions: if has_luks and skip_partitions: