Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-05 21:41:19 +0100
committerAnton Hvornum <anton@hvornum.se>2021-11-05 21:41:19 +0100
commit5df69abfee214cd5c19889b159ec277e43970b32 (patch)
treea2e8bb770183e11648d652c52c1d81377875fcf6 /archinstall/lib
parent0067e349704a4ffae76ae0bcf8cb205a97758b4d (diff)
Stripped down the default zram configuration for zram-generator
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/installer.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 29b884d5..7cf59c22 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -467,10 +467,14 @@ class Installer:
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'):
+
+ # We could use the default example below, but maybe not the best idea: https://github.com/archlinux/archinstall/pull/678#issuecomment-962124813
+ # 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")
+ with open(f"{self.target}/usr/lib/systemd/zram-generator.conf", "w") as zram_conf:
+ zram_conf.write("[zram0]")
+
+ if self.enable_service('systemd-zram-setup@zram0.service'):
return True
else:
raise ValueError(f"Archinstall currently only supports setting up swap on zram")