I'm trying to create a swap partition/file on my board where a core-image-minimal has been installed.
The fdisk -l command doesn't show any partition thus I'm not able to figure out which block device I need to use to create a new partition.
Secondly, launchig a swapon command on a swapfile correctly initialized using mkswap will raise an invalid argument error saying that the file contains holes even though I created it using dd.
At this point I'm not sure if I can do something like this since the free output looks like:
total used free shared buff/cache available
Mem: 503304 32108 101108 216 370088 465180
Swap: 0 0 0
To add any partition to your image, you need to modify the
wksfile that is used for your build.To get the current
wksfile run :Then, look for that file in your layers sources.
In that file you can add (example 1GB swap):
For a real example, you can see the raspberry-pi machine swap support commit here.
You can use a custom
wksfile and set it to your custom machine conf file:For detailed info, check the Yocto reference about wks.