I want to create writable rootfs using Yocto. I tried with meta-readonly-rootfs-overlay layer and just included it into stm32mp135f yocto build process but seems like it is not making a writable readonly rootfs.
I tried with meta-readonly-rootfs-overlay layer with mickeldore branch and just included it into stm32mp135f yocto build process but seems like it is not making a writable readonly rootfs.
You need to add an Image Features, the one you are looking for is
read-only-rootfs.A complete guide is in the docs: Creating the Root Filesystem.
You need to set either
IMAGE_FEATURESorEXTRA_IMAGE_FEATURESwith the added feature.IMAGE_FEATURESif you set it in your image recipe (IMAGE_FEATURES += "read-only-rootfs")EXTRA_IMAGE_FEATURESif you set it in thelocal.conf(EXTRA_IMAGE_FEATURES += "read-only-rootfs"I missed a part of the question, on the overlay.
You can use the overlay class provided by Yocto: overlayfs.bbclass. It provides a way to setup an external partition as an overlay, making it writable for your scripts/binaries/configuration. You can also use overlayfs-etc.bbclass if you only want to overlay
/etc.