summarylogtreecommitdiffstats
path: root/up
diff options
context:
space:
mode:
Diffstat (limited to 'up')
-rwxr-xr-xup13
1 files changed, 13 insertions, 0 deletions
diff --git a/up b/up
new file mode 100755
index 000000000000..28faf085c11b
--- /dev/null
+++ b/up
@@ -0,0 +1,13 @@
+#!/usr/bin/execlineb -P
+# Copyright 2021 Doletov Fyodor
+
+fdmove -c 2 1
+envfile /etc/s6/config/zram.conf
+importas comp_algorithm COMP_ALGORITHM
+importas zram_size ZRAM_SIZE
+
+foreground { modprobe zram }
+foreground { redirfd -w 1 /sys/block/zram0/comp_algorithm echo $comp_algorithm }
+foreground { redirfd -w 1 /sys/block/zram0/disksize echo $zram_size }
+foreground { mkswap --label zram0 /dev/zram0 }
+swapon --priority 100 /dev/zram0