Merge remote-tracking branch 'origin/mount-conf-flexible'

This commit is contained in:
Adriaan de Groot 2018-11-30 12:27:10 +01:00
commit 1fb1189f74
2 changed files with 12 additions and 11 deletions

View File

@ -38,6 +38,8 @@ This release contains contributions from (alphabetically by first name):
* New module *fsresizer* can be used to resize filesystems. It is intended
for use in OEM installs where an image of fixed size is created,
and then sized to the actual SD card the user has used.
* The *mount* module now handles missing *extraMounts* and *extraMountsEfi*
keys gracefully (this is probably a misconfiguration issue).
# 3.2.2 (2018-09-04) #

View File

@ -124,25 +124,24 @@ def run():
"""
root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")
partitions = libcalamares.globalstorage.value("partitions")
extra_mounts = libcalamares.job.configuration["extraMounts"]
extra_mounts_efi = libcalamares.job.configuration["extraMountsEfi"]
# Guard against missing keys (generally a sign that the config file is bad)
extra_mounts = libcalamares.job.configuration.get("extraMounts") or []
extra_mounts_efi = libcalamares.job.configuration.get("extraMountsEfi") or []
if not extra_mounts and not extra_mounts_efi:
libcalamares.utils.warning("No extra mounts defined. Does mount.conf exist?")
# Sort by mount points to ensure / is mounted before the rest
partitions.sort(key=lambda x: x["mountPoint"])
mount_partitions(root_mount_point, partitions)
mount_partitions(root_mount_point, extra_mounts)
fw_type = libcalamares.globalstorage.value("firmwareType")
if fw_type == 'efi':
all_extra_mounts = extra_mounts
if libcalamares.globalstorage.value("firmwareType") == "efi":
mount_partitions(root_mount_point, extra_mounts_efi)
all_extra_mounts.extend(extra_mounts_efi)
libcalamares.globalstorage.insert("rootMountPoint", root_mount_point)
# Remember the extra mounts for the unpackfs module
if fw_type == 'efi':
libcalamares.globalstorage.insert(
"extraMounts", extra_mounts + extra_mounts_efi)
else:
libcalamares.globalstorage.insert("extraMounts", extra_mounts)
return None
libcalamares.globalstorage.insert("extraMounts", all_extra_mounts)