Adding new partition to spi-nand image
-
Hi! I want to create a system image for spi-nand with ubifs where my rootfs partition will be read-only. However, i need a little amount of rw space inside my filesystem. Is it possible to create a dedicated physical partition on a nand flash for that purpose? I can certainly remount nand partitions in /etc/fstab, but i'm not sure that new partition creation is that straightforward. I wonder, is adding new partition to .BoardConfig.mk file enough?
Hello, you can refer to the board level support file for the FASTBOOT suffix under project/cfg/BoardConfig_IPC, the RK_PARTITION_CMD_IN_ENV and RK_PARTITION_FS_TYPE_CFG configuration, set the rootfs partition to read-only erofs format, and set userdata to read-write ubifs format
Thank you!
UPD: I changed following line in my BoardConfig:
Unfortunately the image i build after that doesn't boot and i have kernel panic
In uboot environment i have this boot args:
Is there anything that i can do to make it work? Thanks in advance!
UPD: I changed following line in my BoardConfig:
Code: Select all
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@erofs,oem@/oem@erofs,userdata@/userdata@ubifs
Code: Select all
sys_bootargs= ubi.mtd=6 ubi.block=0,rootfs root=/dev/ubiblock0_0 rootfstype=erofs rk_dma_heap_cma=24M
You can start by looking at the bootarg. The partition information part of the bootarg is composed of env.img. The construction of env.img can be parsed by the build_env running steps in $SDK/project/build.sh. For more information, you need to develop it yourself. We do not have suggestions for changing the file system and the help we can provide is limited.
Ok, got you. Will try to fix it by myself and share with you if something will work out!
I think i'll be fine with rootfs of ubifs and userdata of ubifs. I can remount my rootfs to read-only during boot. However, in spi nand image, it does not mount ubi5_0 block to /userdata successfully. I use your official image and during boot, when S20linkmount tries to mount ubi5_0 as /userdata it can't do that:
So my mount output has no /userdata mounted and in /userdata i only have one file ethaddr.txt. It's weird, how can i properly mount this partition to use it how i want? Thanks in advance.We have not actually tested your development content. From the phenomenon, if the userdata is not successfully mounted, then /userdata is an ordinary directory existing in the rootfs (this needs to be determined using the mount command). The ethaddr.txt is created by the startup script RkLunch.sh, but for a read-only rootfs, creating new files is prohibited. Therefore, you need to determine whether /userdata has been mounted or its read-write permissions have been changed.
In summary, our SDK and the provided startup script are based on a RW system. A read-only system cannot ensure that they can be used. We cannot provide assistance and you need to develop and research by yourself.
In summary, our SDK and the provided startup script are based on a RW system. A read-only system cannot ensure that they can be used. We cannot provide assistance and you need to develop and research by yourself.
It turned out that the issue was in my nand flash that was increased to 512MB. It's related to PEB blocks allocation of ubiattach. Increasing /userdata partition size in board config solved the issue and now i can remount rootfs and oem as read-only and use /userdata as my only rw region. Thanks for your assistance anyways!