Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-10 10:14:15 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-10 10:14:15 +0200
commit1e0770e582b8a32175dfda224a153bf19522fb03 (patch)
tree5aaa2cb86bc40216f5813ba82c42c45523258419 /archinstall/lib/disk.py
parente7ad4038bda9fb5906c4708eb8b48babe9778387 (diff)
Modified encrypted partitions to use partuuid for now.
Diffstat (limited to 'archinstall/lib/disk.py')
-rw-r--r--archinstall/lib/disk.py12
1 files changed, 12 insertions, 0 deletions
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)