index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-04-03 16:22:09 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-04-03 16:22:09 +0200 |
commit | b2927a50670d92bb99e0b8a23e6321e4a8c6f26b (patch) | |
tree | 9f28180993d1fef14a226991bb04dd942f58ba6b /archinstall/lib/disk.py | |
parent | 2bf947ba055722f58b568fc1c984a298ad230ecb (diff) |
-rw-r--r-- | archinstall/lib/disk.py | 11 |
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 @@ -191,6 +191,17 @@ class Partition(): 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 |