How to add partition on Colibri imx6ull

I want to add custom partition.

This partition use aprication rw data.

Please tell me how to create a partition.

Also, I use readonly filesystem as shown below.

Option 1: For this, you could use the OpenEmbedded Kickstart Reference (.wks):

https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-kickstart
https://www.yoctoproject.org/docs/2.6.2/dev-manual/dev-manual.html#creating-partitioned-images-using-wic

The .wks.in (For example my-partition.wks.in) can be placed on a wic folder on your own layer my-layer/wic.

Then, you have details here to create this exact file:

Note that this wks.in only contains part or partition and bootloader commands. Nothing else. You have an example of what it looks like on /meta-toradex-nxp/wic

Then you would need to add this WIK file to the image recipe .bb you will be using WKS_FILE variable.

WKS_FILE ?= " my-partition.wks.in"

Option 2: Using OverlaysFS and SquashFs.

Here we have a Chinese blog on how you can do this: 使用Squashfs和Overlayfs提高嵌入式Linux文件系统可靠性

Google translate works surprisingly well, so please use it as reference.

Kindly try this and let us know how it goes.

Kind regards,
Alvaro.

Do I need to run both Option 1 and Option 2?

Is only option 2 okay?

Is the following not recommended?

https://www.toradex.com/community/questions/49813/read-only-rootfs-writable.html

I think you can choose Option 1 or Option 2. No need to do both. Yes, you can do only Option 2.

Hmm, I think that Option 2 also uses fstab in addition to a systemd service to automatically mount the overlayfs.

This said, in that case I think you don’t need to add the EXTRA_IMAGE_FEATURES_append = " read-only-rootfs" because squashfs is already RO and that would make the overlayfs RO also (I think) and you don’t want that.

For option 1,how do you create the recipe?
Please Sample recipe bb.

I’m afraid we don’t have a sample recipe for this. Please use the available wks.in recipes in the repository as reference.