zram-swap is broken

Rui Salvaterra rsalvaterra at gmail.com
Fri Jul 24 04:34:58 EDT 2020


On Fri, 24 Jul 2020 at 08:43, e9hack <e9hack at gmail.com> wrote:
> Hi,
> zram-swap is since commit 'zram-swap: enable swap discard' broken. Starting zram results in this:
> root at WLAN-DSL8:~# /etc/init.d/zram start
> zram_start: activating '/dev/zram2' for swapping (60 MegaBytes)
> zram_reset: enforcing defaults via /sys/block/zram2/reset
> zram_comp_algo: Set compression algorithm 'lz4' for zram '/dev/zram2'
> Setting up swapspace version 1, size = 60 MiB (62910464 bytes)
> no label, UUID=46afad17-e151-4bcd-8de8-864e517c96c2
> swapon: unrecognized option: d
> Usage: swapon [-s] [-a] [[-p pri] DEVICE]
>         Start swapping on [DEVICE]
>  -a     Start swapping on all swap devices
>  -p pri Set priority of swap device
>  -s     Show summary
> Regards,
> Hartmut

Do you by chance have block-mount installed? The block-mount swapon
utility is more limited than the one BusyBox provides. I sent patches
to remove swapon/swapoff from block-mount (they're not needed to
handle fstab/hotplug swap mounts), but another possibility would be
just to make sure the zram-swap init script calls /sbin/swapon, and
not the first swapon it finds in the path. Let me know what the
preferred solution is, so I can fix it accordingly.


More information about the openwrt-devel mailing list