[U-Boot] u-boot UBI support

Paul B. Henson henson at acm.org
Mon Apr 29 06:41:25 CEST 2013


I'm trying to get u-boot to read from a ubifs volume on an mx28evk
board, and failing :(.

I've got the nand partitioned:

MX28EVK U-Boot > mtdparts  

device nand0 <gpmi-nand>, # parts = 3
 #: name                size            offset          mask_flags
 0: bootloader          0x00300000      0x00000000      0
 1: recovery            0x03200000      0x00300000      0
 2: rootfs_config       0x04b00000      0x03500000      0


and u-boot attaches the partition fine:

MX28EVK U-Boot > ubi part recovery

UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=1"
UBI: MTD device size:            50 MiB
UBI: number of good PEBs:        400
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             16
UBI: total number of reserved PEBs: 384
UBI: number of PEBs reserved for bad PEB handling: 4
UBI: max/mean erase counter: 5/2


but it fails to mount the filesystem:

MX28EVK U-Boot > ubifsmount recovery

UBIFS error (pid 0): ubifs_get_sb: cannot open "recovery", error -22
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
'recovery' errno=-22!


It looks like it sees the volume:

MX28EVK U-Boot > ubi info l
UBI: volume information dump:
UBI: vol_id          0
UBI: reserved_pebs   376
UBI: alignment       1
UBI: data_pad        0
UBI: vol_type        3
UBI: name_len        8
UBI: usable_leb_size 126976
UBI: used_ebs        376
UBI: used_bytes      47742976
UBI: last_eb_bytes   126976
UBI: corrupted       0
UBI: upd_marker      0
UBI: name            recovery

UBI: volume information dump:
UBI: vol_id          2147479551
UBI: reserved_pebs   2
UBI: alignment       1
UBI: data_pad        0
UBI: vol_type        3
UBI: name_len        13
UBI: usable_leb_size 126976
UBI: used_ebs        2
UBI: used_bytes      253952
UBI: last_eb_bytes   2
UBI: corrupted       0
UBI: upd_marker      0
UBI: name            layout volume


but just won't mount it. The same volume mounts from linux fine:

/ # ubiattach -m 1 /dev/ubi_ctrl
[   15.837687] UBI: attaching mtd1 to ubi0
[   16.704968] UBI: scanning is finished
[   16.750187] UBI: attached mtd1 (name "recovery", size 50 MiB) to ubi0
[   16.756906] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   16.763968] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   16.770718] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   16.777781] UBI: good PEBs: 400, bad PEBs: 0, corrupted PEBs: 0
[   16.783875] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   16.791062] UBI: max/mean erase counter: 5/2, WL threshold: 4096, image sequence number: 2129180187
[   16.800281] UBI: available PEBs: 0, total reserved PEBs: 400, PEBs reserved for bad PEB handling: 20
[   16.810031] UBI: background thread "ubi_bgt0d" started, PID 32

/ # mount -t ubifs ubi0:recovery /mnt
[   29.049343] UBIFS: background thread "ubifs_bgt0_0" started, PID 34
[   29.359312] UBIFS: mounted UBI device 0, volume 0, name "recovery"(null)
[   29.366343] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   29.375687] UBIFS: FS size: 46473216 bytes (44 MiB, 366 LEBs), journal size 6348800 bytes (6 MiB, 50 LEBs)
[   29.385531] UBIFS: reserved for root: 0 bytes (0 KiB)
[   29.390625] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 4058B2E3-BA45-4D0D-8A7E-B95D4DCF7E72, small LPT model

/ # ls /mnt
emdebian-rootfs.tar.gz  recovery_dtb.itb        zImage
imx28-evk.dtb           recovery_initramfs.itb
libmodules.tgz          recovery_kernel.itb

Am I missing something here? u-boot is from the git arm branch as of a
few days ago. The ubi stuff was created using linux 3.8.4. Is it too new
for the ubi code in u-boot?

Thanks for any pointers...



More information about the U-Boot mailing list