index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-10-30 17:15:33 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-10-30 17:15:33 +0200 |
commit | 3ee1a5c18e4bf248b54e8da9be6a88cfe042a2b9 (patch) | |
tree | ee7980a51b4e1f533d228ecc1ba5457d60ad2aab /archinstall/lib/disk/helpers.py | |
parent | 4bc164cccc4c95d1f1e12e721aa61bb7299c1cef (diff) |
-rw-r--r-- | archinstall/lib/disk/helpers.py | 17 |
diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index 78bf08ed..341b732f 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -117,7 +117,7 @@ def harddrive(size=None, model=None, fuzzy=False): return collection[drive] -def get_mount_info(path :Union[pathlib.Path, str], traverse=False) -> dict: +def get_mount_info(path :Union[pathlib.Path, str], traverse=False, return_real_path=False) -> dict: for traversal in list(map(str, [str(path)] + list(pathlib.Path(str(path)).parents))): try: log(f"Getting mount information at location {traversal}", level=logging.INFO) @@ -131,16 +131,25 @@ def get_mount_info(path :Union[pathlib.Path, str], traverse=False) -> dict: break if not output: - return {} + if return_real_path: + return {}, None + else: + return {} output = json.loads(output) if 'filesystems' in output: if len(output['filesystems']) > 1: raise DiskError(f"Path '{path}' contains multiple mountpoints: {output['filesystems']}") - return output['filesystems'][0] + if return_real_path: + return output['filesystems'][0], traversal + else: + return output['filesystems'][0] - return {} + if return_real_path: + return {}, traversal + else: + return {} def get_partitions_in_use(mountpoint) -> list: |