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.

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

http://www.toradex.com/community/answers/51649/view.html

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:
https://stackoverflow.com/questions/56187209/yocto-create-and-populate-a-separate-home-partition

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: https://www.toradex.cn/en/blog/shi-yongsquashfs-heoverlayfs-ti-gao-qian-ru-shilinux-wen-jian-xi-tong-ke-kao-xing

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.