Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/filesystem.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/disk/filesystem.py')
-rw-r--r--archinstall/lib/disk/filesystem.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index 5d5952a0..c8eaf0be 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -189,10 +189,13 @@ class Filesystem:
return True
def raw_parted(self, string: str) -> SysCommand:
- if (cmd_handle := SysCommand(f'/usr/bin/parted -s {string}')).exit_code != 0:
- log(f"Parted ended with a bad exit code: {cmd_handle}", level=logging.ERROR, fg="red")
- time.sleep(0.5)
- return cmd_handle
+ try:
+ cmd_handle = SysCommand(f'/usr/bin/parted -s {string}')
+ time.sleep(0.5)
+ return cmd_handle
+ except SysCallError as error:
+ log(f"Parted ended with a bad exit code: {error.exit_code} ({error})", level=logging.ERROR, fg="red")
+ return error
def parted(self, string: str) -> bool:
"""
@@ -258,6 +261,9 @@ class Filesystem:
new_partition_uuids = [partition.part_uuid for partition in self.blockdevice.partitions.values()]
new_partuuid_set = (set(previous_partuuids) ^ set(new_partition_uuids))
+ log(f'Old partition set: {previous_partuuids}', level=logging.INFO, fg="teal")
+ log(f'New partition set: {new_partition_uuids}', level=logging.INFO, fg="teal")
+
if len(new_partuuid_set) and (new_partuuid := new_partuuid_set.pop()):
try:
return self.blockdevice.get_partition(partuuid=new_partuuid)
@@ -282,6 +288,7 @@ class Filesystem:
log(f"Could not find the new PARTUUID after adding the partition.", level=logging.ERROR, fg="red")
log(f"Previous partitions: {previous_partuuids}", level=logging.ERROR, fg="red")
log(f"New partitions: {total_partitions}", level=logging.ERROR, fg="red")
+
raise DiskError(f"Could not add partition using: {parted_string}")
def set_name(self, partition: int, name: str) -> bool: