|
|
|
|
@ -21,6 +21,7 @@ _ = gettext.translation("calamares-python",
|
|
|
|
|
fallback=True).gettext
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pretty_name():
|
|
|
|
|
return _("Configuring OpenRC dmcrypt service.")
|
|
|
|
|
|
|
|
|
|
@ -28,6 +29,7 @@ def pretty_name():
|
|
|
|
|
def write_dmcrypt_conf(partitions, root_mount_point, dmcrypt_conf_path):
|
|
|
|
|
crypto_target = ""
|
|
|
|
|
crypto_source = ""
|
|
|
|
|
unencrypted_separate_boot = any(p["mountPoint"] == "/boot" and "luksMapperName" not in p for p in partitions)
|
|
|
|
|
|
|
|
|
|
for partition in partitions:
|
|
|
|
|
has_luks = "luksMapperName" in partition
|
|
|
|
|
@ -36,7 +38,6 @@ def write_dmcrypt_conf(partitions, root_mount_point, dmcrypt_conf_path):
|
|
|
|
|
if not has_luks and not skip_partitions:
|
|
|
|
|
libcalamares.utils.debug(
|
|
|
|
|
"Skip writing OpenRC LUKS configuration for partition {!s}".format(partition["mountPoint"]))
|
|
|
|
|
|
|
|
|
|
if has_luks and not skip_partitions:
|
|
|
|
|
crypto_target = partition["luksMapperName"]
|
|
|
|
|
crypto_source = "/dev/disk/by-uuid/{!s}".format(partition["uuid"])
|
|
|
|
|
@ -46,7 +47,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:
|
|
|
|
|
dmcrypt_file.write("\ntarget=" + crypto_target)
|
|
|
|
|
dmcrypt_file.write("\nsource=" + crypto_source)
|
|
|
|
|
dmcrypt_file.write("\nkey=/crypto_keyfile.bin")
|
|
|
|
|
# Don't use keyfile if boot is unencrypted, keys must not be stored on unencrypted partitions
|
|
|
|
|
if not unencrypted_separate_boot:
|
|
|
|
|
dmcrypt_file.write("\nkey=/crypto_keyfile.bin")
|
|
|
|
|
dmcrypt_file.write("\n")
|
|
|
|
|
|
|
|
|
|
if has_luks and skip_partitions:
|
|
|
|
|
|