Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-03-08 16:52:06 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-03-08 16:52:06 +0100
commit6306de4bfee2d44ab1f362078a47d6d9a05835ef (patch)
tree5078aa7b94ccaf64cc1c4e0c5004ef2da56ca05a /archinstall/lib/disk.py
parent0b3879ac58d2896ad01270f835fc2819817c6fc1 (diff)
Reworked the guided partitioning logic to better match new expectations of flexability. Still some work to be done and features to be implemented, but the structure is taking place
Diffstat (limited to 'archinstall/lib/disk.py')
-rw-r--r--archinstall/lib/disk.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 2be26585..2f3d8233 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -196,28 +196,34 @@ class Partition():
if b'UUID' not in o:
raise DiskError(f'Could not format {path} with {filesystem} because: {o}')
self.filesystem = 'btrfs'
+
elif filesystem == 'vfat':
o = b''.join(sys_command(f'/usr/bin/mkfs.vfat -F32 {path}'))
if (b'mkfs.fat' not in o and b'mkfs.vfat' not in o) or b'command not found' in o:
raise DiskError(f'Could not format {path} with {filesystem} because: {o}')
self.filesystem = 'vfat'
+
elif filesystem == 'ext4':
if (handle := sys_command(f'/usr/bin/mkfs.ext4 -F {path}')).exit_code != 0:
raise DiskError(f'Could not format {path} with {filesystem} because: {b"".join(handle)}')
self.filesystem = 'ext4'
+
elif filesystem == 'xfs':
if (handle := sys_command(f'/usr/bin/mkfs.xfs -f {path}')).exit_code != 0:
raise DiskError(f'Could not format {path} with {filesystem} because: {b"".join(handle)}')
self.filesystem = 'xfs'
+
elif filesystem == 'f2fs':
if (handle := sys_command(f'/usr/bin/mkfs.f2fs -f {path}')).exit_code != 0:
raise DiskError(f'Could not format {path} with {filesystem} because: {b"".join(handle)}')
self.filesystem = 'f2fs'
+
elif filesystem == 'crypto_LUKS':
from .luks import luks2
encrypted_partition = luks2(self, None, None)
encrypted_partition.format(path)
self.filesystem = 'crypto_LUKS'
+
else:
raise UnknownFilesystemFormat(f"Fileformat '{filesystem}' is not yet implemented.")
return True
@@ -327,7 +333,7 @@ class Filesystem():
if prep_mode == 'luks2':
self.add_partition('primary', start='513MiB', end='100%')
else:
- self.add_partition('primary', start='513MiB', end='100%', format='ext4')
+ self.add_partition('primary', start='513MiB', end='100%', format=prep_mode)
def add_partition(self, type, start, end, format=None):
log(f'Adding partition to {self.blockdevice}', level=LOG_LEVELS.Info)