This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DVRRDK制作UBI文件系统的疑问



我使用DVRRDK4.1,Demo板使用的是三星SLC Nand Flash,型号K9F2G08U0B,用命令make ubifs_128制作ubi文件系统,在makefile中定义如下

ubifs_128:
    $(mtdutils_PATH)/sbin/mkfs.ubifs -r $(TARGET_FS) -F -o ubifs.img -m 2048 -e 126976 -c 1580
    $(mtdutils_PATH)/sbin/ubinize -o $(TFTP_HOME)/ubi_128_$(DVR_RDK_BOARD_TYPE).img -m 2048 -p 128KiB -s 512 -O 2048 $(dvr_rdk_PATH)/makerules/ubinize.cfg
    rm -rf ubifs.img

我对ubi制作工具使用的参数存在疑问。既然ubinize 中有参数“-s 512”,那就说明这是针对Flash有sub-page 512K的情况,而参数“-O”的解释是

-O, --vid-hdr-offset=<num>   offset if the VID header from start of the physical eraseblock (default is the next minimum I/O unit or sub-page after the EC          header)

与其匹配的值应该是512,而此处2048应该是不存在sub-page时所使用的配置。同时,mkfs.ubifs的参数“-e”所带的值是126976,这也是没有sub-page时的配置,有sub-page时应该是129024。感觉此处前后矛盾。

但这样的参数做出来的文件系统烧到Flash中却能正常运行,很不理解。我尝试将mkfs.ubifs中的-e设成129024,在挂载文件系统时会报错,提示

“UBIFS error (pid 1): validate_sb: LEB size mismatch: 129024 in superblock, 126976 real”

这说明我这个Flash是不支持sub-page的吗?可参数中带了“-s 512”又怎么解释呢?