From ee89c55466ec5181b938a03282c0cececd813d58 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Fri, 9 Apr 2021 13:01:01 +0200 Subject: Started patching HOOKS and MODULES based on partition iteration. Also fixed some pseudo code. --- archinstall/lib/installer.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 5af3c226..d8021e05 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -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") -- cgit v1.2.3-70-g09d2