index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | czapek <32851089+48cf@users.noreply.github.com> | 2023-11-21 10:19:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 10:19:17 +0100 |
commit | e6344f93f7e476d05bbcd642f2ed91fdde545870 (patch) | |
tree | 244045a4d9696abe0875ac73b955ef87d061b1cd /archinstall/lib/disk | |
parent | f16af43949085b06478d2e4c45ed61fa8e595171 (diff) |
-rw-r--r-- | archinstall/lib/disk/device_handler.py | 14 |
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 |