zram-swap is broken

Petr Štetiar ynezz at true.cz
Fri Jul 24 06:08:21 EDT 2020


Rui Salvaterra <rsalvaterra at gmail.com> [2020-07-24 09:34:58]:

Hi,

> 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),

perhaps you should send such dependencies as patch series next time.

> 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.

Using /sbin/swapon seems fragile to me as it doesn't mean, that the discard
option is included in that binary. So you probably need to determine the
availability of that discard feature in swapon at runtime and decide whether
you could use that option.

-- ynezz



More information about the openwrt-devel mailing list