Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/partition.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2022-06-07 19:00:48 +1000
committerGitHub <noreply@github.com>2022-06-07 11:00:48 +0200
commitfd131c8fe956858fef802f8e53a530daa0b5df47 (patch)
treea01bc739acb827a554af6e8b9042e5ef16aed527 /archinstall/lib/disk/partition.py
parent644b80d0bd1323bdd47be5103a6ac854679ff5e0 (diff)
Update blockdevice (#1289)
* Update blockdevice class Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/disk/partition.py')
-rw-r--r--archinstall/lib/disk/partition.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index 6f25a5f7..062c79ab 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -175,7 +175,7 @@ class Partition:
return device['pttype']
@property
- def part_uuid(self) -> Optional[str]:
+ def part_uuid(self) -> str:
"""
Returns the PARTUUID as returned by lsblk.
This is more reliable than relying on /dev/disk/by-partuuid as
@@ -222,7 +222,7 @@ class Partition:
For instance when you want to get a __repr__ of the class.
"""
if not self.partprobe():
- if self.block_device.info.get('TYPE') == 'iso9660':
+ if self.block_device.partition_type == 'iso9660':
return None
log(f"Could not reliably refresh PARTUUID of partition {self.device_path} due to partprobe error.", level=logging.DEBUG)
@@ -230,7 +230,7 @@ class Partition:
try:
return SysCommand(f'blkid -s UUID -o value {self.device_path}').decode('UTF-8').strip()
except SysCallError as error:
- if self.block_device.info.get('TYPE') == 'iso9660':
+ if self.block_device.partition_type == 'iso9660':
# Parent device is a Optical Disk (.iso dd'ed onto a device for instance)
return None
@@ -244,15 +244,15 @@ class Partition:
For instance when you want to get a __repr__ of the class.
"""
if not self.partprobe():
- if self.block_device.info.get('TYPE') == 'iso9660':
+ if self.block_device.partition_type == 'iso9660':
return None
log(f"Could not reliably refresh PARTUUID of partition {self.device_path} due to partprobe error.", level=logging.DEBUG)
try:
- return SysCommand(f'blkid -s PARTUUID -o value {self.device_path}').decode('UTF-8').strip()
+ return self.block_device.uuid
except SysCallError as error:
- if self.block_device.info.get('TYPE') == 'iso9660':
+ if self.block_device.partition_type == 'iso9660':
# Parent device is a Optical Disk (.iso dd'ed onto a device for instance)
return None
@@ -399,7 +399,7 @@ class Partition:
elif filesystem == 'vfat':
options = ['-F32'] + options
-
+ log(f"/usr/bin/mkfs.vfat {' '.join(options)} {path}")
if (handle := SysCommand(f"/usr/bin/mkfs.vfat {' '.join(options)} {path}")).exit_code != 0:
raise DiskError(f"Could not format {path} with {filesystem} because: {handle.decode('UTF-8')}")
self.filesystem = filesystem