How to enable swapping on S805 m201d?

  • I would like to enable swapping for the LibreELEC 8.2.3.1-m201d because AmLogic S805 TV Box has only 512 Mb RAM and freezes on the YouTube browsing.

    What I do:

    1) Set the build options to:

    Code
    SWAP_SUPPORT="yes"
    SWAP_ENABLED_DEFAULT="no"
    SWAPFILESIZE="256"

    and the Linux kernel options to:

    Code
    CONFIG_SWAP=y
    FRONTSWAP=y
    HIBERNATION=n
    MTD_SWAP=n
    ZCACHE=y
    ZCACHE_DEBUG=n

    2) Compile and create the developer release image, install the image to the SD Card and boot it.

    3) Customise the swap configuration file:

    Code
    #cp /etc/swap.conf /storage/.config/
    #sed -i 's/SWAP_ENABLED="no"/SWAP_ENABLED="yes"/' /storage/.config/swap.conf

    and create the file /storage/.config/autostart.sh with contents:

    Bash
    #!/bin/sh
    sysctl -qw vm.swappiness=40

    But after all the swapping does not work:

    What is my mistake?

  • Hmm. Just tried on my S905x (LibreELEC (wrxtasy-kszaq): 8.2.4.2-S905Test-1529136339 (S912.arm)
    ) and it doesn't work.

    My guess is that swapping was NOT enabled in the kernel - for these devices it was not necessary (oodles of RAM).

    If you *really* need swap then you are doing something beyond the concept of LE or just doing too much for your box.

  • edjalmo : Thank you. I've did the same things on the S805 Box, but unsuccessfully.

    Iridium: You're right, swapping was not enabled in the kernel. Therefore I've rebuilt the kernel with the swapping support. And Linux creates the swap-file during booting process. But it doesn't use it in its work...