aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/zram-swap/files/zram.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/system/zram-swap/files/zram.init')
-rwxr-xr-xpackage/system/zram-swap/files/zram.init5
1 files changed, 3 insertions, 2 deletions
diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index 42c084855a..bfb9285600 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -85,8 +85,9 @@ zram_comp_algo()
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