OpenWrt Forum Archive

Topic: Kamikaze 7.09 on RB532 NAND

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I compiled Kamikaze for RB532 an tried to flash the following vmlinux.elf generated in the build_mipsel/linux-2.6-rb532/, I get this

RouterBOOT booter 2.12

RouterBoard 532

CPU frequency: 264 MHz
  Memory size:  32 MB

Press any key within 1 seconds to enter setup.
kernel not found
trying dhcp protocol... OK
resolved mac address 00:18:39:EE:0A:EC
Gateway: 192.168.1.2
transfer started ........................ transfer ok, time=3.52s
setting up elf image... OK
jumping to kernel code
Linux version 2.6.21.5 (ken@desar) (gcc version 4.1.2) #1 Mon Feb 18 10:42:07 NPT 2008
CPU revision is: 0001800a
Determined physical RAM map:
memory: 01fffa00 @ 00000400 (usable)
Wasting 32 bytes for tracking 1 unused pages
Initrd not found or empty - disabling initrd
Built 1 zonelists.  Total pages: 8128
Kernel command line: console=ttyS0,115200 gpio=16383 kmac=00:0C:42:04:48:A1 board=500 boot=1
korina mac = 00:0C:42:04:48:A1
Primary instruction cache 8kB, physically tagged, 4-way, linesize 16 bytes.
Primary data cache 8kB, 4-way, linesize 16 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
Initializing IRQ's: 168 out of 256
PID hash table entries: 128 (order: 7, 512 bytes)
calculating r4koff... 00142440(1320000)
CPU frequency 264.00 MHz
Using 132.000 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28816k/32760k available (2076k kernel code, 3944k reserved, 323k data, 120k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Initializing PCI
registering PCI controller with io_map_base unset
NET: Registered protocol family 2
Time: MIPS clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
squashfs: version 3.0 (2006/03/15) Phillip Lougher
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
yaffs Feb 18 2008 10:39:46 Installing.
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 104) is a 16550A
cf-mips module loaded
cf-mips: cf card not present
Trying to free already-free IRQ 149
rb500-cf: probe of rb500-cf.0 failed with error 1
Using NAPI with weight 64
eth0: Rx IRQ 40, Tx IRQ 41, 00:0c:42:04:48:a1
via-rhine.c:v1.10-LK1.4.3 2007-03-06 Written by Donald Becker
PCI: Enabling device 0000:00:02.0 (0080 -> 0083)
io_map_base of root PCI bus 0000:00 unset.  Trying to continue but you better
fix this issue or report it to linux-mips@linux-mips.org or your vendor.
eth1: VIA Rhine III at 0xb8800000, 00:0c:42:04:48:a2, IRQ 142.
eth1: MII PHY found at address 1, status 0x7849 advertising 05e1 Link 0000.
PCI: Enabling device 0000:00:03.0 (0080 -> 0083)
eth2: VIA Rhine III at 0xb8800100, 00:0c:42:04:48:a3, IRQ 143.
eth2: MII PHY found at address 1, status 0x7849 advertising 05e1 Link 0000.
block2mtd: version $Revision: 1.30 $
RB500 nand
dev2base 0x18a20000 mask 0xffff0000 c 0x02d43a00 tc 0x00001336
NAND device: Manufacturer ID: 0xad, Chip ID: 0xf1 (Hynix NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 2 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000-0x00400000 : "RouterBoard NAND Boot"
0x00400000-0x08000000 : "RouterBoard NAND Main"
nf_conntrack version 0.5.0 (255 buckets, 2040 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP vegas registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Cannot open root device "<NULL>" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)





Can anyone tell me what could be wrong, I followed the documentation of howto is the wiki
http://wiki.openwrt.org/OpenWrtDocs/Har … otik/RB532

I haven't installed OpenWrt on an RB532, but from a glance at the wiki page it looks like you install it the same way as the RB1xx.  (The RB532 wiki page seems to skip a bunch of instructions, though.)

It looks like you're netbooting a non-netboot kernel.  The netboot kernel has a root filesystem embedded in it.  The one you're booting doesn't seem to have the root fs, and there's no fs on your flash, so the kernel panics.

Try recompiling, but where you specify the image type, choose "netboot".  (This will disable the other options like tgz, cpio, ext2, etc.)  This should generate a netboot kernel with the rootfs embedded in it.  After booting that you should be able to download the real kernel and rootfs to /tmp and write them to the flash.

See if the instructions here help:
http://wiki.openwrt.org/OpenWrtDocs/Har … otik/RB100

(There might not be a wget2nand script for RB532, though, so follow the instructions in the RB532 wiki page after you have booted the netboot kernel if wget2nand does not work.)

(Last edited by Wodin on 18 Feb 2008, 15:21)

I flashed the image, now I get this

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "RouterBoard NAND Boot"
mtd1: 07c00000 00020000 "RouterBoard NAND Main"


There is no rootfs as specified in documentation
root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "Routerboard NAND boot"
mtd1: 07c00000 00020000 "rootfs"


So I could not get it boot to openwrt.

OK, I think this changed at some point.  (For RB1xx, and probably for RB532 too).

The name doesn't matter too much.  You will notice that the size is correct.

The current version of OpenWrt for adm5120 (rb1xx) names the partitions kernel and rootfs, but older versions had the "RouterBoard NAND..." stuff.  Write the kernel to "... Boot" and the fs to "... Main".

By the way, I see there is a wget2nand script for rb532 in trunk, but not in 7.09.  There is, however, a cf2nand in 7.09 and it expects the partitions to be named as your are:
cf2nand

I tried again, did everthing as mentioned in documentation, but the router doesnt boot from NAND

it says this while  rebooting
root@OpenWrt:/# save exit: isCheckpointed 1                                     
yaffs: dev is 32505857 name is "mtdblock1"                                     
yaffs: passed flags ""                                                         
yaffs: Attempting MTD mount on 31.1, "mtdblock1"                               
yaffs: auto selecting yaffs2                                                   
yaffs: restored from checkpoint                                                 
save exit: isCheckpointed 1                                                     
                                                                               
root@OpenWrt:/#                                                                 
root@OpenWrt:/# reboot                                                         
The system is going down NOW !!                                                 
Sending SIGTERM to all processes.                                               
: umount: tmpfs busy - remounted read-only

Those message should not be a problem. What does it say while booting? Does the bootloader find the kernel on the flash?

It would not boot as it couldn't find kernel.

I downloaded everything from http://wifi.ozo.com/airo/openwrt/firmwa … /2.6/rb5xx including the vmlinux.

I mounted the nand boot, and made a dir called tmp and installed kernel there
I mounted rootfs and made a dir called tmp and installed rootfs.tgz file there and rebooted

It didn't boot from kernel. As I was running dnsmasq in other machine which provided boot image and it booted from there, as I mounted nandboot, I could see that the tmp directory and the kernel was there, so I copied the kernel from /mnt/tmp to /mnt only and deleted the tmp folder

similarly I copied rootfs.tgz from /mnt/tmp from the mtdblock1 to /mnt only and deleted the old tmp directory.

Then I rebooted, and now it booted from nand.

I think my boot image was lacking some files.

My bootimage would create only tmpfs partition, the bootimage from the wifi.ozo.com created one more partition apart from tmpfs. I think that was the difference

nepalken wrote:

It would not boot as it couldn't find kernel.

I downloaded everything from http://wifi.ozo.com/airo/openwrt/firmwa … /2.6/rb5xx including the vmlinux.

I mounted the nand boot, and made a dir called tmp and installed kernel there
I mounted rootfs and made a dir called tmp and installed rootfs.tgz file there and rebooted

OK, the instructions look a little wrong.

The "tmp" directory mentioned in the instructions is /tmp (i.e. in RAM, not on the flash.)  You are supposed to put the kernel directly onto the boot partition.  Not in a subdirectory called tmp.  It's similar for the rootfs.

I see you worked it out.

The instructions should probably look like this:

mount /dev/mtdblock0 /mnt
cd /tmp
wget http://wifi.ozo.com/airo/openwrt/firmware/kamikaze/2.6/rb5xx/10304/kernel
mv /tmp/kernel /mnt
umount /mnt
mount /dev/mtdblock1 /mnt
wget http://wifi.ozo.com/airo/openwrt/firmware/kamikaze/2.6/rb5xx/10304/openwrt-rb532-2.6-rootfs.tgz
cd /mnt
tar xzvf /tmp/openwrt-rb532-2.6-rootfs.tgz
cd /
umount /mnt

Woodin,

Thank you for your assistance and clarifying to everyone the extra step needed to flash RB532.

Just wanted to post a correction for the use of the wget2nand command when flashing the RB routers. When you build kamikaze using the trunk the NAND kernel image file needs to be renamed, you have to add the "2.6" to the name. The kernel should be called "openwrt-adm5120-2.6-rb1xx-kernel" so wget2nand can find it. The rootfs file does not need to be renamed.

Rob

The discussion might have continued from here.