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).
This commit is contained in:
parent
116246b0e8
commit
c6fdf775c8
|
|
@ -299,9 +299,8 @@ class Partition:
|
||||||
elif filesystem == 'fat32':
|
elif filesystem == 'fat32':
|
||||||
options = ['-F32'] + options
|
options = ['-F32'] + options
|
||||||
|
|
||||||
mkfs = SysCommand(f"/usr/bin/mkfs.vfat {' '.join(options)} {path}").decode('UTF-8')
|
if (handle := SysCommand(f"/usr/bin/mkfs.vfat {' '.join(options)} {path}")).exit_code != 0:
|
||||||
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: {handle.decode('UTF-8')}")
|
||||||
raise DiskError(f"Could not format {path} with {filesystem} because: {mkfs}")
|
|
||||||
self.filesystem = filesystem
|
self.filesystem = filesystem
|
||||||
|
|
||||||
elif filesystem == 'ext4':
|
elif filesystem == 'ext4':
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue