Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk
diff options
context:
space:
mode:
authorRomain Goncalves <accounts@rgoncalves.se>2022-01-08 21:16:19 +0100
committerGitHub <noreply@github.com>2022-01-08 21:16:19 +0100
commitc6fdf775c8b601a9b94f7c12849276e0b6fe0bfe (patch)
tree3b1c0a4f2f6cae4148ac2a3115f725c8b6547314 /archinstall/lib/disk
parent116246b0e8e593edae54221dfba8134cbc1c223c (diff)
partition.py: Use exit code for mkfs.fat exception (#853)
When using archinstall on an existing Arch Linux installation, (e.g. for migrating the current system on a new drive), no exception is raised if mkfs.vfat is missing in the base install (no dosfstools package currently installed).
Diffstat (limited to 'archinstall/lib/disk')
-rw-r--r--archinstall/lib/disk/partition.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py
index b8fa2b79..56ead68c 100644
--- a/archinstall/lib/disk/partition.py
+++ b/archinstall/lib/disk/partition.py
@@ -299,9 +299,8 @@ class Partition:
elif filesystem == 'fat32':
options = ['-F32'] + options
- mkfs = SysCommand(f"/usr/bin/mkfs.vfat {' '.join(options)} {path}").decode('UTF-8')
- if ('mkfs.fat' not in mkfs and 'mkfs.vfat' not in mkfs) or 'command not found' in mkfs:
- raise DiskError(f"Could not format {path} with {filesystem} because: {mkfs}")
+ 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
elif filesystem == 'ext4':