index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-04-10 10:14:15 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-04-10 10:14:15 +0200 |
commit | 1e0770e582b8a32175dfda224a153bf19522fb03 (patch) | |
tree | 5aaa2cb86bc40216f5813ba82c42c45523258419 /archinstall/lib/disk.py | |
parent | e7ad4038bda9fb5906c4708eb8b48babe9778387 (diff) |
-rw-r--r-- | archinstall/lib/disk.py | 12 |
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index e5aa9a85..1a2dc4dc 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -126,6 +126,18 @@ class BlockDevice(): def partition_table_type(self): return GPT + @property + def uuid(self): + log(f'BlockDevice().uuid is untested!', level=LOG_LEVELS.Warning, fg='yellow') + """ + Returns the disk UUID 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 -o+UUID {self.path}')) + for partition in json.loads(lsblk.decode('UTF-8'))['blockdevices']: + return partition.get('uuid', None) + def has_partitions(self): return len(self.partitions) |