From 30880d77470d0eca39cd48aa0b4e4f9b48bd6cc0 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 22 Dec 2022 13:19:02 +0100 Subject: [PATCH] Adding debug information --- archinstall/lib/disk/helpers.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index d2655977..68b5b28e 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -230,15 +230,20 @@ def get_blockdevice_info(device_path, exclude_iso_dev :bool = True) -> Dict[str, except SysCallError as ex: if ex.exit_code in (512, 2): # Assume that it's a loop device, and try to get info on it + try: + resolved_device_name = device_path.readlink().name + except OSError: + resolved_device_name = device_path.name + try: information = get_loop_info(device_path) if not information: print("Exit code for blkid -p -o export was:", ex.exit_code) - raise SysCallError(f"Could not get loop information for {device_path.readlink().name}", exit_code=1) + raise SysCallError(f"Could not get loop information for {resolved_device_name}", exit_code=1) except SysCallError: - print(f"Not a loop device, trying uevent rules for {device_path.readlink().name}") - information = get_blockdevice_uevent(device_path.readlink().name) + print(f"Not a loop device, trying uevent rules for {resolved_device_name}") + information = get_blockdevice_uevent(resolved_device_name) return enrich_blockdevice_information(information) else: # We could not reliably get any information, perhaps the disk is clean of information?