New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS#359 - kirkwood: kernel does not recognize rootfs in ubi #5409
Comments
bobafetthotmail1: Btw, I'm using the same dtb I use to boot Debian on it. |
diizzyy: nbd kindly committed fixes recently which might be of interest, this makes my iomega iconnect device boot and flash properly. |
bobafetthotmail1: Sadly, that patch is unrelated (he changes the nand partition names of some kirkwood devices from "root" to "ubi"). My nand partitions already had the right names. I just built an image with kernel outside of ubi (using same sources as I used for the bug report) and everything works fine. These are the partitions I have on flash now (before there was only ubi after the uboot stuff). [ 0.870019] 0x000000000000-0x000000100000 : "uboot" this is the part about ubi not failing like before and actually doing its job. [ 1.030586] UBI: auto-attach mtd3 And I get to serial console afterwards. So, there are either issues with the kernel patch that detects multiple partitions in ubi when there is also the kernel in it, or I did something wrong. |
bobafetthotmail1: a full boot log, in case someone is interested [ 0.000000] Booting Linux on physical CPU 0x0 |
bobafetthotmail1: And a mailing list thread with another guy (J Mo) that encounters the same issue when adding a new device [ 3.781181] ubi0: attaching mtd11 but then hoses his uboot and the thread stops |
nbd: Fixed in r2904-3be4c6ca93 |
bobafetthotmail1:
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
The text was updated successfully, but these errors were encountered: