add ALGORITHM variable to /etc/default/zramswap
I suggest to allow users to set the compression algorithm in the default config, like this:
(this code, exept for the ALGORITHM part, is copied from the original script, zramswap)
for core in $(seq 0 $(($cores - 1))); do
echo $ALGORITHM > /sys/block/zram$core/comp_algorithm
echo $(($ALLOCATION / $cores)) > /sys/block/zram$core/disksize
mkswap /dev/zram$core
swapon -p $PRIORITY /dev/zram$core
done
Default algorithm should be set at the beginning, I suggest lz4. Available (on my system) is:
$ cat /sys/block/zram0/comp_algorithm
lzo lz4 [lz4hc]