switch default to btrfs, switch to consistent units, fix wasted space on EFI systems

This commit is contained in:
askiiart 2024-10-01 11:54:01 -05:00
parent 29cfb63d20
commit a030f9147a
Signed by untrusted user who does not match committer: askiiart
GPG key ID: EA85979611654C30

View file

@ -149,17 +149,17 @@ def inst_partition(config):
# Create GPT label
exec(['parted', '-s', device, 'mklabel', 'gpt'])
# Create EFI partition
exec(['parted', '-s', device, 'mkpart', 'fat32', '0', '500'])
exec(['parted', '-s', device, 'mkpart', 'fat32', '0%', '512MiB'])
else:
# Create msdos label
exec(['parted', '-s', device, 'mklabel', 'msdos'])
# Create boot partition
exec(['parted', '-s', device, 'mkpart',
'primary', 'ext4', '1MIB', '1400MIB'])
'primary', 'ext4', '0%', '512MiB'])
# Create root partition
exec(['parted', '-s', device, 'mkpart',
'primary', 'ext4', '1500MB', '100%'])
'primary', 'btrfs', '513MiB', '100%'])
global orig_main_partition
@ -176,7 +176,7 @@ def inst_partition(config):
exec(['cryptsetup', 'open', root_partition, 'new_root', '-'], input=f'{password}\n')
root_partition = '/dev/mapper/new_root'
# Format root partition
exec(['mkfs.ext4', '-F', root_partition])
exec(['mkfs.btrfs', '-F', root_partition])
# Mount partitions
mount(root_partition, '/mnt')
mkdir('/mnt/boot')
@ -194,7 +194,7 @@ def inst_partition(config):
exec(['cryptsetup', 'open', root_partition, 'new_root', '-'], input=f'{password}\n')
root_partition = '/dev/mapper/new_root'
# Format root partition
exec(['mkfs.ext4', '-F', root_partition])
exec(['mkfs.btrfs', '-F', root_partition])
# Mount partitions
mount(root_partition, '/mnt')
mkdir('/mnt/boot')