diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index 4233001c2..4151ada4a 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -55,9 +55,16 @@ def run(): mount_partitions(root_mount_point, partitions) 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) 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 diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index 1823cdac2..a545cd0f2 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -43,16 +43,11 @@ ON_POSIX = 'posix' in sys.builtin_module_names def list_excludes(destination): - prefix = destination.replace('//', '/') - if not prefix.endswith('/'): - prefix = prefix + '/' - lst = [] - for line in open('/etc/mtab').readlines(): - 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:] + '/']) + extra_mounts = globalstorage.value("extraMounts") + for extra_mount in extra_mounts: + mount_point = extra_mount["mountPoint"] + if mount_point: + lst.extend(['--exclude', mount_point + '/']) return lst