index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-11-11 18:11:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-11 18:11:38 +0000 |
commit | ca52c796a55fd34cc1309f26bab86e15da722182 (patch) | |
tree | 6dd56f60f5445920788fc1a94d1e93f34c78aea7 /archinstall/lib/disk/partition.py | |
parent | 9b944b90b151a616e36f7361c7cf3c6951e61970 (diff) | |
parent | c0bf44e0ae82bf2e379e57965c0e21694b61cd3c (diff) |
-rw-r--r-- | archinstall/lib/disk/partition.py | 12 |
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py index e9688965..3630a6f4 100644 --- a/archinstall/lib/disk/partition.py +++ b/archinstall/lib/disk/partition.py @@ -32,7 +32,10 @@ class Partition: if mountpoint: self.mount(mountpoint) - mount_information = get_mount_info(self.path) + try: + mount_information = get_mount_info(self.path) + except DiskError: + mount_information = {} if self.mountpoint != mount_information.get('target', None) and mountpoint: raise DiskError(f"{self} was given a mountpoint but the actual mountpoint differs: {mount_information.get('target', None)}") @@ -145,8 +148,11 @@ class Partition: it doesn't seam to be able to detect md raid partitions. """ - lsblk = json.loads(SysCommand(f'lsblk -J -o+PARTUUID {self.path}').decode('UTF-8')) - for partition in lsblk['blockdevices']: + partuuid_struct = SysCommand(f'lsblk -J -o+PARTUUID {self.path}') + if not partuuid_struct.exit_code == 0: + raise DiskError(f"Could not get PARTUUID for {self.path}: {partuuid_struct}") + + for partition in json.loads(partuuid_struct.decode('UTF-8'))['blockdevices']: return partition.get('partuuid', None) return None |