Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorThomas <9749173+uhthomas@users.noreply.github.com>2022-01-20 17:49:18 +0000
committerGitHub <noreply@github.com>2022-01-20 17:49:18 +0000
commit34488d25c57d39745ab5127ab992adcdb1b97d80 (patch)
tree4edeb9e01803335cdf90d58f0daf7e4d63a2513b /archinstall/lib/installer.py
parent671bf7595c44633db60ce3e139fcc4ccda891325 (diff)
Disable zswap (#883)
Disable zswap when using zram. The swap device is now initialised before the bootloader, inline with the installation guide.
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 4ba304f6..438f2119 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -619,8 +619,11 @@ class Installer:
with open(f"{self.target}/etc/systemd/zram-generator.conf", "w") as zram_conf:
zram_conf.write("[zram0]\n")
- if self.enable_service('systemd-zram-setup@zram0.service'):
- return True
+ self.enable_service('systemd-zram-setup@zram0.service')
+
+ self.zram_enabled = True
+
+ return True
else:
raise ValueError(f"Archinstall currently only supports setting up swap on zram")
@@ -727,6 +730,12 @@ class Installer:
if bind_path is not None: # and root_fs_type == 'btrfs':
options_entry = f"rootflags=subvol={bind_path} " + options_entry
+ # Zswap should be disabled when using zram.
+ #
+ # https://github.com/archlinux/archinstall/issues/881
+ if self.zram_enabled:
+ options_entry = "zswap.enabled=0 " + options_entry
+
if real_device := self.detect_encryption(root_partition):
# TODO: We need to detect if the encrypted device is a whole disk encryption,
# or simply a partition encryption. Right now we assume it's a partition (and we always have)