Fix unpackfs wrongly excluding separately-mounted partitions.

mount: Remember the extraMounts (and extraMountsEfi, if applicable) in
the global storage (as "extraMounts").

unpackfs: Read the extra mounts from the global storage to generate the
exclude list instead of trying to detect it from the "mount" command's
output, because the latter also includes normally-mounted destination
partitions.

This makes having separate partitions for non-/ mountpoints work again.
main
Kevin Kofler 10 years ago
parent 20e6cd4ab0
commit e6d65d047b

@ -55,9 +55,16 @@ def run():
mount_partitions(root_mount_point, partitions) mount_partitions(root_mount_point, partitions)
mount_partitions(root_mount_point, extra_mounts) mount_partitions(root_mount_point, extra_mounts)
if(os.path.exists("/sys/firmware/efi/efivars")): fw_type = libcalamares.globalstorage.value("firmwareType")
if fw_type == 'efi':
mount_partitions(root_mount_point, extra_mounts_efi) mount_partitions(root_mount_point, extra_mounts_efi)
libcalamares.globalstorage.insert("rootMountPoint", root_mount_point) 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 return None

@ -43,16 +43,11 @@ ON_POSIX = 'posix' in sys.builtin_module_names
def list_excludes(destination): def list_excludes(destination):
prefix = destination.replace('//', '/') extra_mounts = globalstorage.value("extraMounts")
if not prefix.endswith('/'): for extra_mount in extra_mounts:
prefix = prefix + '/' mount_point = extra_mount["mountPoint"]
lst = [] if mount_point:
for line in open('/etc/mtab').readlines(): lst.extend(['--exclude', mount_point + '/'])
device, mount_point, _ = line.split(" ", 2)
if mount_point.startswith(prefix):
# -1 to include the leading / from the end of the prefix
# also add a trailing /
lst.extend(['--exclude', mount_point[len(prefix)-1:] + '/'])
return lst return lst

Loading…
Cancel
Save