Correct way to permanently configure swap?

What is the correct way to permanently configure swap on the Turris Omnia? I’ve created a swap partition on the SSD in my Omnia, and activated it with swapon , but what is the correct way to permanently configure it - to have it enabled on boot?

Related topic

In /etc/config/fstab add:

config swap
	option enabled '1'
	option uuid '8995e736-688e-4b46-9ead-b2d5eda75917'

Of course, use your partition ID. You can find it in block info command.

Thanks. I couldn’t get Busybox’s mkswap to give it an UUID so went with the device option. Haven’t rebooted yet, so cannot say for sure that it works. Will update here later.

My /etc/config/fstab did not exist, so I created it.

root@turris:~# mkswap /dev/sda1
Setting up swapspace version 1, size = 8589930496 bytes
root@turris:~# lsblk --output NAME,SIZE,TYPE,UUID
sda          119.2G disk
├─sda1           8G part
└─sda2       111.2G part d75a3914-44e3-4013-890f-2074d59f5fb8
mtdblock0      960K disk
mtdblock1        7M disk
mtdblock2       64K disk
mmcblk0        7.3G disk
└─mmcblk0p1    7.3G part b7bc537b-2f80-40a5-a64f-afc1beeeed0f
mmcblk0boot0     4M disk
mmcblk0boot1     4M disk
config swap
        option enabled '1'
        option device '/dev/sda1'

It did not work, after reboot swap was not activated.

Make sure your service /etc/init.d/fstab is enabled and started