index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2022-10-12 14:17:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 14:17:14 +0200 |
commit | eec45643e950a5b982e1478ef57497491ec37f73 (patch) | |
tree | 9be7abbe48a2a466203f7063bf4754a1dc57618f /archinstall/lib/disk/filesystem.py | |
parent | 5c8eb7144d9583a8a117a4e892b1e78be1324a28 (diff) |
-rw-r--r-- | archinstall/lib/disk/filesystem.py | 15 |
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: |