index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | archinstall/lib/installer.py | 12 |
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 11a0f24e..29b884d5 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -463,6 +463,18 @@ class Installer: return True + def setup_swap(self, kind='zram'): + if kind == 'zram': + self.log(f"Setting up swap on zram") + self.pacstrap('zram-generator') + zram_example_location = '/usr/share/doc/zram-generator/zram-generator.conf.example' + shutil.copy2(f"{self.target}{zram_example_location}", f"{self.target}/usr/lib/systemd/zram-generator.conf") + + if self.enable_service('systemd-zram-setup@zram0.service') and self.enable_service('systemd-zram-setup@zram1.service'): + return True + else: + raise ValueError(f"Archinstall currently only supports setting up swap on zram") + def add_bootloader(self, bootloader='systemd-bootctl'): for plugin in plugins.values(): if hasattr(plugin, 'on_add_bootloader'): |