From b2927a50670d92bb99e0b8a23e6321e4a8c6f26b Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 3 Apr 2021 16:22:09 +0200 Subject: This should fix #151, by using lsblk instead of /dev/disk/by-partuuid. It also cleaned up the installer code quite a bit during the bootloader installation. Will do the same for encrypted drives later on by implementing UUID on a BlockDevice (disk) level. --- archinstall/lib/disk.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'archinstall/lib/disk.py') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 44d46c8b..8fbc50b2 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -190,6 +190,17 @@ class Partition(): else: return f'Partition(path={self.path}, fs={self.filesystem}{mount_repr})' + @property + def uuid(self) -> str: + """ + Returns the PARTUUID as returned by lsblk. + This is more reliable than relying on /dev/disk/by-partuuid as + it doesn't seam to be able to detect md raid partitions. + """ + lsblk = b''.join(sys_command(f'lsblk -J {self.path}')) + for partition in json.loads(lsblk.decode('UTF-8'))['blockdevices']: + return partition['partuuid'] + @property def encrypted(self): return self._encrypted -- cgit v1.2.3-70-g09d2