Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/helpers.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-10-30 16:16:43 +0200
committerAnton Hvornum <anton@hvornum.se>2021-10-30 16:16:43 +0200
commit6be071b6e0d43a2fded8a3fd773525fb1216aa91 (patch)
tree72c8ff033d55c71e9aa7c17ffff5bad542dcb01c /archinstall/lib/disk/helpers.py
parentd3aec52d986718f8d4f15063aa656dc4627dae81 (diff)
Enhanced get_mount_info() to recursively get the information
Diffstat (limited to 'archinstall/lib/disk/helpers.py')
-rw-r--r--archinstall/lib/disk/helpers.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py
index 2e84a657..0111d327 100644
--- a/archinstall/lib/disk/helpers.py
+++ b/archinstall/lib/disk/helpers.py
@@ -117,10 +117,13 @@ def harddrive(size=None, model=None, fuzzy=False):
def get_mount_info(path :Union[pathlib.Path, str]) -> dict:
- try:
- output = SysCommand(f'/usr/bin/findmnt --json {path}').decode('UTF-8')
- except SysCallError:
- return {}
+ for traversal in list(map(str, [str(path)] + list(pathlib.Path(str(path)).parents))):
+ try:
+ output = SysCommand(f'/usr/bin/findmnt --json {traversal}').decode('UTF-8')
+ if output:
+ break
+ except SysCallError:
+ pass
if not output:
return {}
@@ -132,6 +135,8 @@ def get_mount_info(path :Union[pathlib.Path, str]) -> dict:
return output['filesystems'][0]
+ return {}
+
def get_partitions_in_use(mountpoint) -> list:
from .partition import Partition