Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk
diff options
context:
space:
mode:
authorczapek <32851089+48cf@users.noreply.github.com>2023-11-21 10:19:17 +0100
committerGitHub <noreply@github.com>2023-11-21 10:19:17 +0100
commite6344f93f7e476d05bbcd642f2ed91fdde545870 (patch)
tree244045a4d9696abe0875ac73b955ef87d061b1cd /archinstall/lib/disk
parentf16af43949085b06478d2e4c45ed61fa8e595171 (diff)
Fix Limine bootloader deployment (#2216)
* Add `get_unique_path_for_device` to `DeviceHandler` * Fix Limine bootloader deployment * Fail if UKI is enabled with Limine * Support more configuration options with Limine * Fix linter errors * Fix boot partition fs_type check for Limine
Diffstat (limited to 'archinstall/lib/disk')
-rw-r--r--archinstall/lib/disk/device_handler.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py
index 50e8c59c..fcf52013 100644
--- a/archinstall/lib/disk/device_handler.py
+++ b/archinstall/lib/disk/device_handler.py
@@ -133,6 +133,20 @@ class DeviceHandler(object):
lsblk = get_lsblk_info(dev_path)
return Path(f'/dev/{lsblk.pkname}')
+ def get_unique_path_for_device(self, dev_path: Path) -> Optional[Path]:
+ paths = Path('/dev/disk/by-id').glob('*')
+ linked_targets = {p.resolve(): p for p in paths}
+ linked_wwn_targets = {p: linked_targets[p] for p in linked_targets
+ if p.name.startswith('wwn-') or p.name.startswith('nvme-eui.')}
+
+ if dev_path in linked_wwn_targets:
+ return linked_wwn_targets[dev_path]
+
+ if dev_path in linked_targets:
+ return linked_targets[dev_path]
+
+ return None
+
def get_uuid_for_path(self, path: Path) -> Optional[str]:
partition = self.find_partition(path)
return partition.partuuid if partition else None