Problem flashing new version from openwrt.org

Started by mubes, February 25, 2016, 01:49:03 AM

Previous topic - Next topic

mubes

Hi Folks,

I cloned trunk from openwrt.org and copied the .config file over from the olimex repository, but it does not want to boot (I fixed the memory size issue).  It seems that, for some reason, it is not accessing the MTD as a valid boot device and I'm getting the "VFS: Unable to mount root fs on unknown-block(0,0)" kernel panic. I'm pretty sure I'm doing something very silly, but if someone has a .config from a reasonably recent image from openwrt.org I'd surely appreciate it so I can see where I've developed the sticky fingers...

Regards

DAVE

JohnS

.config should match how it was built but yours doesn't.

Re-build to match the config you want.

John

mubes

Hi John,

Thanks for the reply, but I'm afraid it's not too useful. Here is what I've done;


make distclean
wget https://raw.githubusercontent.com/OLIMEX/openwrt/rt5350f/.config
make menuconfig
make

Magic happens, and  I get a complete build.

cd bin/ramips/
cp openwrt-ramips-rt305x-rt5350f-olinuxino-squashfs-sysupgrade.bin /tftpboot/openwrt.bin

When I boot this new image I get a kernel panic when it tries to boot the root fs.  I don't know why. As far as I can see I have the correct filesystems and MTD drivers in the kernel. My bootlog is below.

## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32

Starting kernel ...

[    0.000000] Linux version 4.3.4 (dave@dagaronne) (gcc version 5.2.0 (OpenWrt GCC 5.2.0 r48719) ) #1 Thu Feb 25 17:37:24 UTC 2016
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is Olimex RT5350F-OLinuXino
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Writing ErrCtl register=00055300
[    0.000000] Readback ErrCtl register=00055300
[    0.000000] Memory: 28560K/32768K available (2707K kernel code, 120K rwdata, 640K rodata, 172K init, 191K bss, 4208K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 360MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 10618113593 ns
[    0.000016] sched_clock: 32 bits at 180MHz, resolution 5ns, wraps every 11930464253ns
[    0.015669] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[    0.090879] pid_max: default: 32768 minimum: 301
[    0.100284] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.113354] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.135828] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.155678] pinctrl core: initialized pinctrl subsystem
[    0.167422] NET: Registered protocol family 16
[    0.183338] rt2880-pinmux pinctrl: invalid group "rgmii" for function "gpio"
[    0.197337] rt2880-pinmux pinctrl: invalid group "mdio" for function "gpio"
[    0.244002] rt2880_gpio 10000600.gpio: registering 22 gpios
[    0.255118] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[    0.267788] rt2880_gpio 10000660.gpio: registering 6 gpios
[    0.278715] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[    0.293796] clocksource: Switched to clocksource MIPS
[    0.306590] NET: Registered protocol family 2
[    0.316932] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.330827] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.343408] TCP: Hash tables configured (established 1024 bind 1024)
[    0.356274] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.367900] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.380882] NET: Registered protocol family 1
[    0.390623] rt-timer 10000100.timer: maximum frequency is 3662Hz
[    0.404681] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.459449] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.471058] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.496838] io scheduler noop registered
[    0.504649] io scheduler deadline registered (default)
[    0.516465] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.531585] console [ttyS0] disabled
[    0.538775] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.558486] console [ttyS0] enabled
[    0.558486] console [ttyS0] enabled
[    0.572271] bootconsole [early0] disabled
[    0.572271] bootconsole [early0] disabled
[    0.598397] spi spi0.0: force spi mode3
[    0.606802] m25p80 spi0.0: en25q64 (8192 Kbytes)
[    0.616183] 4 ofpart partitions found on MTD device spi0.0
[    0.627172] Creating 4 MTD partitions on "spi0.0":
[    0.636782] 0x000000000000-0x000000030000 : "u-boot"
[    0.650334] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.664957] 0x000000040000-0x000000050000 : "factory"
[    0.678884] 0x000000050000-0x000000400000 : "firmware"
[    0.718178] rt3050-esw 10110000.esw: link changed 0x00
[    0.730144] mtk_soc_eth 10100000.ethernet: generated random MAC address a2:6b:0c:ab:a4:1d
[    0.748022] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.765726] rt2880_wdt 10000120.watchdog: Initialized
[    0.778490] NET: Registered protocol family 10
[    0.795394] NET: Registered protocol family 17
[    0.804624] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    0.829907] 8021q: 802.1Q VLAN Support v1.8
[    0.844399] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.859439] Please append a correct "root=" boot option; here are the available partitions:
[    0.876148] 1f00             192 mtdblock0  (driver?)
[    0.886280] 1f01              64 mtdblock1  (driver?)
[    0.896404] 1f02              64 mtdblock2  (driver?)
[    0.906529] 1f03            3776 mtdblock3  (driver?)
[    0.916649] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.935273] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

JohnS

I was just pointing out the problem I believed with what you had done.

Now it looks like you have some other problem(s).  Maybe someone else will help you with this next.

John

mubes

I'm afraid the problem remains as it was, I just documented it a bit better.  I've just updated to current head at openwrt.org with no positive effect :-(  Hopefully someone has a working .config for current openwrt.org...

Regards

DAVE

JohnS

It should include a working one.  But you wrote yours to it.

John

mubes

Not quite - I wrote the Olimex .config into the openwrt.org build....but that doesn't work.  I'm currently cooking a olimex build with the Olimex config (which should, of course, work perfectly) and then I'll start looking for differences and try and understand what is going on.

Regards

DAVE

mubes

Ah, now I'm getting somewhere.  The 'olimex sourced' build didn't work either. I was tftpbooting from RAM.  Once I burnt the new image to flash it worked correctly, so obviously my understanding of how it all holds together was/is wrong and the tftpbooted image isn't starting up in the way I understood it was.  Interestingly, now the image is in flash, it will boot correctly over tftp too.

As things currently stand I can get the olimex source build booting, so I'm currently on the tail of it.  I'm just doing a clean build of the openwrt.org tree again overnight and check that I can boot _that_ in a similar fashion. Tomorrow I'll post exactly what was going on (once I understand it) in case anyone else gets hit with something like this.

DAVE

mubes

OK, So I think this bit is the clue;

[    0.637162] Creating 4 MTD partitions on "spi0.0":
[    0.646773] 0x000000000000-0x000000030000 : "u-boot"
[    0.660325] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.674969] 0x000000040000-0x000000050000 : "factory"
[    0.688904] 0x000000050000-0x000000400000 : "firmware"
[    0.721844] 2 uimage-fw partitions found on MTD device firmware
[    0.733778] 0x000000050000-0x000000174674 : "kernel"
[    0.747479] 0x000000174674-0x000000400000 : "rootfs"

The rootfs comes _directly_ after the kernel, which of course mesns that if the kernel size changes, the location of the rootfs in the flash changes.  I had (wrongly) assumed that booting into RAM via tftp would result in the rootfs image that had been downloaded being used, but it obviously takes the one that's in flash, and probably at the wrong location for this specific boot.

This is all covered at https://wiki.openwrt.org/doc/techref/flash.layout. There's a layer of understanding below this that I don't yet have (when the non-working boots found the 'firmware' partition, why didn't they scan it for kernel, rootfs and rootfs_data? Is this a subtle bug because its booted from ram?), but it's sufficient for now to know what I did wrong, in the hope that it will help others faced with the same issues.

DAVE