Skip to content

Commit 42da789

Browse files
authored
Re-add workaround for zram module loading
8f120ca Removed this workaround, but it seems to be needed. Fixes #161
1 parent 996a78d commit 42da789

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

systemd-swap

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ case $1 in
253253
if [[ ! -d /sys/module/zram ]]; then
254254
INFO "Zram: not part of kernel, trying to find zram module"
255255
modprobe -n zram || ERRO "Zram: can't find zram module!"
256-
modprobe zram
256+
# workaround for some zram initialization problems
257+
for (( i = 0; i < 10; ++i )); do
258+
[[ -d /sys/module/zram ]] && break
259+
modprobe zram
260+
snore 0.2
261+
done
257262
INFO "Zram: module successfully loaded"
258263
else
259264
INFO "Zram: module already loaded" && readonly ZRAM_ALREADY_SET=true

0 commit comments

Comments
 (0)