Started patching HOOKS and MODULES based on partition iteration. Also fixed some pseudo code.

This commit is contained in:
Anton Hvornum 2021-04-09 13:01:01 +02:00
parent 5c8d210f5f
commit ee89c55466
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 10 additions and 7 deletions

View File

@ -276,6 +276,16 @@ class Installer():
if partition.filesystem == 'f2fs':
self.base_packages.append('f2fs-tools')
# Configure mkinitcpio to handle some specific use cases.
if partition.filesystem == 'btrfs'
if 'btrfs' not in MODULES:
MODULES.append('btrfs')
if '/usr/bin/btrfs-progs' not in BINARIES:
BINARIES.append('/usr/bin/btrfs')
elif partition.encrypted and 'encrypt' not in HOOKS:
HOOKS.insert(HOOKS.find('filesystems'), 'encrypt')
self.pacstrap(self.base_packages)
self.helper_flags['base-strapped'] = True
#self.genfstab()
@ -295,13 +305,6 @@ class Installer():
# TODO: Use python functions for this
sys_command(f'/usr/bin/arch-chroot {self.target} chmod 700 /root')
# Configure mkinitcpio to handle some specific use cases.
if self.partition.filesystem == 'btrfs':
MODULES.append('btrfs')
BINARIES.append('/usr/bin/btrfs')
elif self.partition.encrypted:
HOOKS.patch('encrypt', before='filesystems')
with open(f'{self.target}/etc/mkinitcpio.conf', 'w') as mkinit:
mkinit.write(f"MODULES=({' '.join(MODULES)})\n")
mkinit.write(f"BINARIES=({' '.join(BINARIES)})\n")