local dev="$1"
local zram_comp_algo="$( uci -q get system.@system[0].zram_comp_algo )"
- if [ -z "$zram_comp_algo" ] || [ ! -e /sys/block/$( basename $dev )/comp_algorithm ]; then
- return 0
+ if [ -z "$zram_comp_algo" ]; then
+ # lzo-rle fails on small RAM devices, default to lzo, which is always available
+ zram_comp_algo="lzo"
fi
if [ $(grep -c "$zram_comp_algo" /sys/block/$( basename $dev )/comp_algorithm) -ne 0 ]; then