[FS#359] kirkwood: kernel does not recognize rootfs in ubi

LEDE Bugs lede-bugs at lists.infradead.org
Tue Dec 27 13:02:19 PST 2016


A new Flyspray task has been opened.  Details are below. 

User who did this - Alberto Bursi (bobafetthotmail1) 

Attached to Project - LEDE Project
Summary - kirkwood: kernel does not recognize rootfs in ubi
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Medium
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - I'm trying to add support for a ZyXEL NSA310 (kirkwood-based NAS), but the kernel does not find the rootfs in the ubi.

The image has kernel+rootfs+rootfs_data in ubi, built with
FILESYSTEMS := squashfs
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi
KERNEL_IN_UBI := 1

If I boot the initramfs (ramdisk) system image while there is a ubi image flashed to nand, it gives this error while booting

[ 1.070706] UBI: auto-attach mtd2
[ 1.073868] ubi0: attaching mtd2
[ 1.083812] UBI: EOF marker found, PEBs from 28 will be erased
[ 1.089971] ubi0: scanning is finished
[ 1.093994] ubi0 error: ubi_read_volume_table: the layout volume was not found
[ 1.101458] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd2, error -22
[ 1.108559] UBI error: cannot attach mtd2

but since ubi isn't necessary for the initramfs image, it works fine and I get to system console.

If I boot the firmware image from nand (and set uboot for booting from ubi, with NO bootargs passed to the kernel), the kernel boots until it finds the same error above, and then it posts this

[ 1.605331] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 1.612865] Please append a correct "root=" boot option; here are the available partitions:
[ 1.621268] 1f00 1024 mtdblock0 (driver?)
[ 1.626346] 1f01 512 mtdblock1 (driver?)
[ 1.631439] 1f02 129024 mtdblock2 (driver?)
[ 1.636521] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

And auto-reboots.

I've tried with bootargs like ubi.mtd=2 but with any bootarg about root= or ubi it simply hangs and does not even start the kernel (shortly after uboot executes the kernel the device restarts).

the ubi partition seems to be OK according to uboot (see output of various uboot commands). Any help appreciated. 

NSA310> ubi part ubi
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=2", size 126 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 1008, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1235565284
ubi0: available PEBs: 0, total reserved PEBs: 1008, PEBs reserved for bad PEB handling: 20

NSA310> ubi info
UBI: MTD device name: "mtd=2"
UBI: MTD device size: 126 MiB
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: number of good PEBs: 1008
UBI: number of bad PEBs: 0
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 3
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 1008
UBI: number of PEBs reserved for bad PEB handling: 20
UBI: max/mean erase counter: 1/0

NSA310> ubi info l
Volume information dump:
        vol_id          0
        reserved_pebs   16
        alignment       1
        data_pad        0
        vol_type        3
        name_len        6
        usable_leb_size 129024
        used_ebs        16
        used_bytes      2064384
        last_eb_bytes   129024
        corrupted       0
        upd_marker      0
        name            kernel
Volume information dump:
        vol_id          1
        reserved_pebs   10
        alignment       1
        data_pad        0
        vol_type        3
        name_len        6
        usable_leb_size 129024
        used_ebs        10
        used_bytes      1290240
        last_eb_bytes   129024
        corrupted       0
        upd_marker      0
        name            rootfs
Volume information dump:
        vol_id          2
        reserved_pebs   958
        alignment       1
        data_pad        0
        vol_type        3
        name_len        11
        usable_leb_size 129024
        used_ebs        958
        used_bytes      123604992
        last_eb_bytes   129024
        corrupted       0
        upd_marker      0
        name            rootfs_data
Volume information dump:
        vol_id          2147479551
        reserved_pebs   2
        alignment       1
        data_pad        0
        vol_type        3
        name_len        13
        usable_leb_size 129024
        used_ebs        2
        used_bytes      258048
        last_eb_bytes   2
        corrupted       0
        upd_marker      0
        name            layout volume

More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=359



More information about the lede-bugs mailing list