From 7a018415862677c165494decc5d8ad9e06c65fb7 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 16 Dec 2021 09:00:10 +0000 Subject: Changed lsblk to blkid where possible (#802) * Swapped lsblk for blkid * Added a hefty sleep on partprobe() And added a TODO for the future --- archinstall/lib/disk/helpers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/disk/helpers.py') diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index 9442f1b6..8e6a79e4 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -214,10 +214,14 @@ def find_partition_by_mountpoint(block_devices, relative_mountpoint :str): def partprobe(): SysCommand(f'bash -c "partprobe"') + time.sleep(5) def convert_device_to_uuid(path :str) -> str: for i in range(storage['DISK_RETRY_ATTEMPTS']): partprobe() + + # TODO: Convert lsblk to blkid + # (lsblk supports BlockDev and Partition UUID grabbing, blkid requires you to pick PTUUID and PARTUUID) output = json.loads(SysCommand(f"lsblk --json -o+UUID {path}").decode('UTF-8')) for device in output['blockdevices']: @@ -226,4 +230,4 @@ def convert_device_to_uuid(path :str) -> str: time.sleep(storage['DISK_TIMEOUTS']) - raise DiskError(f"Could not retrieve the UUID of {path} within a timely manner.") \ No newline at end of file + raise DiskError(f"Could not retrieve the UUID of {path} within a timely manner.") -- cgit v1.2.3-54-g00ecf