ZHDA242 July 2026 TDA4VE-Q1
UBIFS 卷可以使用 Linux UBIFS 驱动程序挂载。
创建挂载点并挂载卷。
root@j721s2-evm:~# mkdir -p /mnt/ospi_rootfs
root@j721s2-evm:~# mount -t ubifs -o compr=none ubi0:rootfs /mnt/ospi_rootfs
[ 378.881540] UBIFS (ubi0:0): default file-system created
[ 378.886938] UBIFS (ubi0:0): Mounting in unauthenticated mode
[ 378.892793] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1188
[ 378.924191] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[ 378.931604] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
[ 378.941248] UBIFS (ubi0:0): FS size: 54761344 bytes (52 MiB, 209 LEBs), max 219 LEBs, journal size 2620160 bytes (2 MiB, 10 LEBs)
[ 378.952889] UBIFS (ubi0:0): reserved for root: 2586513 bytes (2525 KiB)
[ 378.959495] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID 0D0FF060-F89F-4D12-B474-1C6AA3288A8D, small LPT model
root@j721s2-evm:~#可以使用标准的 Linux 文件操作来验证已挂载的文件系统。
例如,
root@j721s2-evm:~# echo hello > /mnt/ospi_rootfs/test.txt
root@j721s2-evm:~# sync
root@j721s2-evm:~# cat /mnt/ospi_rootfs/test.txt
hello
root@j721s2-evm:~#除了在 Linux 上进行验证之外,还可以从 U-Boot 环境验证 UBIFS 卷。此步骤确保在存储 Linux 引导工件之前可以由 U-Boot 访问在 Linux 中创建的文件系统。
使用了以下命令。
=> ubi part ospi.rootfs
=> ubifsmount ubi0:rootfs
=> ubifsls /
示例输出如下所示。
=> ubi part ospi.rootfs
k3-navss-ringacc ringacc@2b800000: Ring Accelerator probed rings:286, gp-rings[96,20] sci-dev-id:272
k3-navss-ringacc ringacc@2b800000: dma-ring-reset-quirk: disabled
jedec_spi_nor flash@0: non-uniform erase sector maps are not supported yet.
cadence_spi spi@47040000: Pattern not found. Skipping calibration
SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
jedec_spi_nor flash@0: Software reset enable failed: -524
cadence_spi spi@47050000: Pattern not found. Skipping calibration
SF: Detected mt25qu512a with page size 256 Bytes, erase size 64 KiB, total 64 MiB
Could not find a valid device for spi-nand0
ubi0: attaching mtd7
ubi0: scanning is finished
ubi0: attached mtd7 (name "ospi.rootfs", size 55 MiB)
ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16
ubi0: VID header offset: 64 (aligned 64), data offset: 128
ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 7/3, WL threshold: 4096, image sequence number: 1854191452
ubi0: available PEBs: 0, total reserved PEBs: 223, PEBs reserved for bad PEB handling: 0
=> ubifsmount ubi0:rootfs
UBIFS (ubi0:0): recovery needed
UBIFS (ubi0:0): recovery deferred
UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
UBIFS (ubi0:0): FS size: 54761344 bytes (52 MiB, 209 LEBs), journal size 2620160 bytes (2 MiB, 10 LEBs)
UBIFS (ubi0:0): reserved for root: 2586513 bytes (2525 KiB)
UBIFS (ubi0:0): media format: w5/r0 (latest is w4/r0), UUID 0D0FF060-F89F-4D12-B474-1C6AA3288A8D, small LPT model
=> ubifsls /
6 Fri May 30 02:46:03 2025 test.txt
=>成功执行这些命令确认 U-Boot 可以正确识别在 Linux 中创建的 UBI 元数据和 UBIFS 卷,并且可以在存储 Linux 引导文件之前访问这些卷。
成功读取和写入操作确认如下。
• 可访问 OSPI NOR 闪存分区。
• UBI 设备工作正常。
• UBIFS 卷可以从 Linux 和 U-Boot 环境中挂载和使用。
此时,rootfs 卷已准备好存储下一章中所述的 Linux 内核映像、DTB 和根文件系统元件。