From 16852f95010b0de8cc2f677884bdc92f4af21e06 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 23 Feb 2023 09:02:58 +0100 Subject: [PATCH] Added some errro handling for weird block devices --- archinstall/lib/disk/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index 5e473070..2a02d5ec 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -266,7 +266,10 @@ def all_blockdevices( # we'll iterate the /sys/class definitions and find the information # from there. for block_device in glob.glob("/sys/class/block/*"): - device_path = pathlib.Path(f"/dev/{pathlib.Path(block_device).readlink().name}") + try: + device_path = pathlib.Path(f"/dev/{pathlib.Path(block_device).readlink().name}") + except FileNotFoundError: + log(f"Unknown device found by '/sys/class/block/*', ignoring: {device_path}", level=logging.WARNING, fg="yellow") if device_path.exists() is False: log(f"Unknown device found by '/sys/class/block/*', ignoring: {device_path}", level=logging.WARNING, fg="yellow")