1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- /usr/lib/systemd/scripts/zramctrl.orig	2014-05-25 08:12:00.000000000 -0400
+++ /usr/lib/systemd/scripts/zramctrl	2014-06-21 19:18:58.255386196 -0400
@@ -4,6 +4,7 @@
 start() {
   exec awk -v ZRAM_SIZE=$ZRAM_SIZE -v ZRAM_PARM="$(modinfo zram | grep -E -o '(num_devices|zram_num_devices)')" '
 
+  COMP = "lz4"
   FILENAME == "/proc/cpuinfo" && ($1 == "processor" || $1 == "Processor") {
     cpucount++
     next
@@ -23,6 +24,7 @@
 
     for (i = 0; i < cpucount; i++) {
       print mem_per_cpu > "/sys/block/zram" i "/disksize"
+      print COMP > "/sys/block/zram" i "/comp_algorithm"
       system("mkswap /dev/zram" i " -L zram" i)
       swapdevs = swapdevs " /dev/zram" i
     }
@@ -47,4 +49,4 @@
 
 case $1 in
   start|stop) "$1" ;;
-esac
\ No newline at end of file
+esac