reworked intendation

This commit is contained in:
Alf Gaida 2017-06-02 19:58:36 +02:00
parent 33b5cefebb
commit 5ed51bc5b0

View File

@ -44,14 +44,14 @@ def mount_partitions(root_mount_point, partitions):
fstype = "vfat" fstype = "vfat"
if "luksMapperName" in partition: if "luksMapperName" in partition:
libcalamares.utils.debug("about to mount " libcalamares.utils.debug(
+ partition["luksMapperName"]) "about to mount {!s}".format(partition["luksMapperName"]))
libcalamares.utils.mount("/dev/mapper/" libcalamares.utils.mount(
+ partition["luksMapperName"], "/dev/mapper/{!s}".format(partition["luksMapperName"]),
mount_point, mount_point,
fstype, fstype,
partition.get("options", ""), partition.get("options", ""),
) )
else: else:
libcalamares.utils.mount(partition["device"], libcalamares.utils.mount(partition["device"],
@ -84,39 +84,36 @@ def mount_partitions(root_mount_point, partitions):
subprocess.check_call(["umount", "-v", root_mount_point]) subprocess.check_call(["umount", "-v", root_mount_point])
if "luksMapperName" in partition: if "luksMapperName" in partition:
libcalamares.utils.mount("/dev/mapper/" libcalamares.utils.mount(
+ partition["luksMapperName"], "/dev/mapper/{!s}".format(partition["luksMapperName"]),
mount_point, mount_point,
fstype, fstype,
",".join(["subvol=@", ",".join(
partition.get("options", ["subvol=@", partition.get("options", "")]),
"")]), )
)
if not has_home_mount_point: if not has_home_mount_point:
libcalamares.utils.mount("/dev/mapper/" libcalamares.utils.mount(
+ partition["luksMapperName"], "/dev/mapper/{!s}".format(partition["luksMapperName"]),
root_mount_point + "/home", root_mount_point + "/home",
fstype, fstype,
",".join(["subvol=@home", ",".join(
partition.get("options", ["subvol=@home", partition.get("options", "")]),
"")]), )
)
else: else:
libcalamares.utils.mount(partition["device"], libcalamares.utils.mount(
mount_point, partition["device"],
fstype, mount_point,
",".join(["subvol=@", fstype,
partition.get("options", ",".join(["subvol=@", partition.get("options", "")]),
"")]), )
)
if not has_home_mount_point: if not has_home_mount_point:
libcalamares.utils.mount(partition["device"], libcalamares.utils.mount(
root_mount_point + "/home", partition["device"],
fstype, root_mount_point + "/home",
",".join(["subvol=@home", fstype,
partition.get("options", ",".join(
"")]), ["subvol=@home", partition.get("options", "")]),
) )
def run(): def run():
@ -143,8 +140,8 @@ def run():
# Remember the extra mounts for the unpackfs module # Remember the extra mounts for the unpackfs module
if fw_type == 'efi': if fw_type == 'efi':
libcalamares.globalstorage.insert("extraMounts", libcalamares.globalstorage.insert(
extra_mounts + extra_mounts_efi) "extraMounts", extra_mounts + extra_mounts_efi)
else: else:
libcalamares.globalstorage.insert("extraMounts", extra_mounts) libcalamares.globalstorage.insert("extraMounts", extra_mounts)