Tool/software:
The ubifs file has been successfully created and correctly flashed. However, mounting is not occurring. A kernel panic is being triggered.
When attempting the same process with jffs2, it functions correctly with the same mtd partitions.
Could you please provide assistance to enable booting with ubifs?
Error Log:
[ 1.908562] List of all partitions:
[ 1.912094] 0100 65536 ram0
[ 1.912101] (driver?)
[ 1.917987] 0101 65536 ram1
[ 1.917991] (driver?)
[ 1.923931] 0102 65536 ram2
[ 1.923936] (driver?)
[ 1.929820] 0103 65536 ram3
[ 1.929824] (driver?)
[ 1.935751] 0104 65536 ram4
[ 1.935756] (driver?)
[ 1.941675] 0105 65536 ram5
[ 1.941680] (driver?)
[ 1.947562] 0106 65536 ram6
[ 1.947566] (driver?)
[ 1.953466] 0107 65536 ram7
[ 1.953470] (driver?)
[ 1.959352] 0108 65536 ram8
[ 1.959355] (driver?)
[ 1.965252] 0109 65536 ram9
[ 1.965256] (driver?)
[ 1.971168] 010a 65536 ram10
[ 1.971172] (driver?)
[ 1.977139] 010b 65536 ram11
[ 1.977142] (driver?)
[ 1.983123] 010c 65536 ram12
[ 1.983127] (driver?)
[ 1.989092] 010d 65536 ram13
[ 1.989096] (driver?)
[ 1.995075] 010e 65536 ram14
[ 1.995079] (driver?)
[ 2.001078] 010f 65536 ram15
[ 2.001082] (driver?)
[ 2.007053] 1f00 15360 mtdblock0
[ 2.007057] (driver?)
[ 2.013374] 1f01 1024 mtdblock1
[ 2.013379] (driver?)
[ 2.019679] 1f02 128 mtdblock2
[ 2.019682] (driver?)
[ 2.025997] 1f03 1024 mtdblock3
[ 2.026001] (driver?)
[ 2.032332] 1f04 256 mtdblock4
[ 2.032336] (driver?)
[ 2.038637] 1f05 256 mtdblock5
[ 2.038641] (driver?)
[ 2.044956] 1f06 1024 mtdblock6
[ 2.044960] (driver?)
[ 2.051275] 1f07 51200 mtdblock7
[ 2.051279] (driver?)
[ 2.057579] 1f08 122880 mtdblock8
[ 2.057583] (driver?)
[ 2.063917] 1f09 1024 mtdblock9
[ 2.063921] (driver?)
[ 2.070222] 1f0a 71680 mtdblock10
[ 2.070226] (driver?)
[ 2.076627] 1f0b 10240 mtdblock11
[ 2.076631] (driver?)
[ 2.083041] No filesystem could mount root, tried:
[ 2.083046] ubifs
[ 2.087745]
[ 2.091133] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8)
[ 2.099198] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8) ]---
Linux SDK: Version 4.19.59 for Linux.
NAND flash: MT29F2G16
Nand flash size: 256MB (2Gb)
file system partition size: 120MB
DTB partitions:
partition@0 {
label = "NAND.SPL";
reg = <0x00000000 0x00020000>;
};
partition@1 {
label = "NAND.u-boot";
reg = <0x00020000 0x00100000>;
};
partition@2 {
label = "NAND.u-boot-env";
reg = <0x00120000 0x00040000>;
};
partition@3 {
label = "NAND.u-boot-env-redund";
reg = <0x00160000 0x00040000>;
};
partition@4 {
label = "NAND.User DTB";
reg = <0x001A0000 0x00100000>;
};
partition@5 {
label = "NAND.User Kernel";
reg = <0x002A0000 0x03200000>;
};
partition@6 {
label = "NAND.User FileSystem";
reg = <0x034A0000 0x07800000>;
};
partition@7 {
label = "NAND.golden DTB";
reg = <0x0ACA0000 0x00100000>;
};
partition@8 {
label = "NAND.golden Kernel";
reg = <0x0ADA0000 0x04600000>;
};
partition@9 {
label = "NAND.Test Partition";
reg = <0x0F3A0000 0x00A00000>;
Note: Total 12 partitions, 0 and 1 partitions are NOR flash partitions and 2 to 11 are NAND partitions. So, user filesystem partition number is 8.
command used used to create ubifs:
1. mkfs.ubifs -r <fs_source_dir> -m 1024 -e 0x20000 -c 960 -o <fs_dest_dir>/rootfs.ubifs
2. ubinize -o <fs_dest_dir>/rootfs.ubi -m 1024 -p 128KiB -s 512 -v <fs_dest_dir>/ubinize.cfg
3. cfg file:
[ubifs]
mode=ubi
image=<fs_dest_dir>/rootfs.ubifs
vol_id=0
vol_size=120MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
u-boot commands used to flash and boot:
1. tftpboot 0x8f000000 rootfs.ubi
2. nand erase 0x034A0000 0x07800000
3. nand write 0x8f000000 0x034A0000 <rootfs_size>
4. setenv bootargs console=ttyS0,115200n8 ubi.mtd=8 root=ubi0:rootfs rootfstype=ubifs rw