index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2022-04-26 21:57:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 21:57:33 +0200 |
commit | a63e8ae7f99ac41673536cfcf8fcc5c4d724a2ee (patch) | |
tree | 03ed9d0156f1d0c407805c2c2e2873d8050207b6 /archinstall/lib/disk | |
parent | 59c35df0676977c93ed7276237179c9af8d9c476 (diff) |
-rw-r--r-- | archinstall/lib/disk/partition.py | 20 |
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py index a44efa26..e7568258 100644 --- a/archinstall/lib/disk/partition.py +++ b/archinstall/lib/disk/partition.py @@ -192,7 +192,9 @@ class Partition: For bind mounts all the subvolumes share the same uuid """ for i in range(storage['DISK_RETRY_ATTEMPTS']): - self.partprobe() + if not self.partprobe(): + raise DiskError(f"Could not perform partprobe on {self.device_path}") + time.sleep(max(0.1, storage['DISK_TIMEOUTS'] * i)) partuuid = self._safe_uuid @@ -208,13 +210,11 @@ class Partition: This function should only be used where uuid is not crucial. For instance when you want to get a __repr__ of the class. """ - try: - self.partprobe() - except SysCallError as partprobe_error: + if not self.partprobe(): if self.block_device.info.get('TYPE') == 'iso9660': return None - raise DiskError(f"Could not get PARTUUID of partition {self} due to partprobe error: {partprobe_error}") + log(f"Could not reliably refresh PARTUUID of partition {self.device_path} due to partprobe error.", level=logging.DEBUG) try: return SysCommand(f'blkid -s PARTUUID -o value {self.device_path}').decode('UTF-8').strip() @@ -223,7 +223,7 @@ class Partition: # Parent device is a Optical Disk (.iso dd'ed onto a device for instance) return None - raise DiskError(f"Could not get PARTUUID of partition {self}: {error}") + log(f"Could not get PARTUUID of partition using 'blkid -s PARTUUID -o value {self.device_path}': {error}") @property def encrypted(self) -> Union[bool, None]: @@ -267,8 +267,12 @@ class Partition: yield result def partprobe(self) -> bool: - if self.block_device and SysCommand(f'partprobe {self.block_device.device}').exit_code == 0: - return True + try: + if self.block_device: + return 0 == SysCommand(f'partprobe {self.block_device.device}').exit_code + except SysCallError as error: + log(f"Unreliable results might be given for {self.path} due to partprobe error: {error}", level=logging.DEBUG) + return False def detect_inner_filesystem(self, password :str) -> Optional[str]: |