#1 2009-12-14 11:44:18
[OpenWRT] Can not mount rootfs.
Hi 大家好,
最近我嘗試在Atheros公版上面測試OpenWRT. 我使用SVN把最新的source code抓下來,然後build DIR-825的firmware. 然後用tftp 把openwrt-ar71xx-uImage-gzip.bin 跟 openwrt-ar71xx-root.jffs2-64k更新到flash.
可是console上面卻連MTD partitions都沒有建立. 請問一下這該怎麼debug??
Starting kernel ...
Linux version 2.6.30.10 (jamesc@218-32-67-227.static.sparqnet.net) (gcc version
4.3.3 (GCC) ) #1 Mon Dec 14 11:52:55 CST 2009
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2, CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
Determined physical RAM map:
memory: 04000000 @ 00000000 (usable)
User-defined physical RAM map:
memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,1152
00 console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ar7
100-nor0:192k(uboot),64k(env),6144k(rootfs),1728k(uImage),64k(caldata) mem=64M
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
NR_IRQS:56
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 61900k/65536k available (1939k kernel code, 3568k reserved, 427k data, 1
36k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 528 bytes
NET: Registered protocol family 16
MIPS: machine is Generic AR71xx board
bio: create slab at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY) 穢 2001-2006 Red Hat, Inc.
yaffs Dec 14 2009 11:50:50 Installing.
msgmni has been set to 121
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
Atheros AR71xx SPI Controller driver version 0.2.4
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear
All bugs added by David S. Miller
VFS: Cannot open root device "31:02" or unknown-block(31,2)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
離線
#2 2009-12-21 22:59:38
Re: [OpenWRT] Can not mount rootfs.
算是找到原因了,不過還沒完全解決
基於不能射後不理的原則,還是上來分享一下.
沒有辦法mount root file system的原因是因為沒有找到mtd partition.
沒有找到mtd partition是因為沒有這個spi flash device.
沒有這個device的原因是因為沒有抓到正確的board data.
在build_dir/linux-ar71xx/linux-2.6.30.10/arch/mips/ar71xx/setup.c中的ar71xx_machine_setup()
會把ar71xx_mach當做參數傳給mips_machine_setup(),
而我的問題就在於ar71xx_mach永遠等於AR71XX__MACHGENERIC(0),
也就是沒有辦法對應到正確的board type.
這個參數是在prom.c中決定.
似乎是沒辦法找到board這個環境變數,
所以造成ar71xx_mach一直維持在prom_init()中的AR71XX__MACHGENERIC.
解法,先暫時在呼叫mips_machine_setup()的時候給固定的常數
mips_machine_setup(AR71XX_MACH_DIR_825_B1);
這樣就會照著mach-dir-825-b1.c中的dir825b1_setup() 來配置.
下一步應該就是找到prom.c中的board變數是怎麼弄的......
希望對研究openWRT的人有幫助.
離線
#3 2009-12-23 21:04:43
Re: [OpenWRT] Can not mount rootfs.
jamesjan 提到:
算是找到原因了,不過還沒完全解決
基於不能射後不理的原則,還是上來分享一下.
沒有辦法mount root file system的原因是因為沒有找到mtd partition.
沒有找到mtd partition是因為沒有這個spi flash device.
沒有這個device的原因是因為沒有抓到正確的board data.
在build_dir/linux-ar71xx/linux-2.6.30.10/arch/mips/ar71xx/setup.c中的ar71xx_machine_setup()
會把ar71xx_mach當做參數傳給mips_machine_setup(),
而我的問題就在於ar71xx_mach永遠等於AR71XX__MACHGENERIC(0),
也就是沒有辦法對應到正確的board type.
這個參數是在prom.c中決定.
似乎是沒辦法找到board這個環境變數,
所以造成ar71xx_mach一直維持在prom_init()中的AR71XX__MACHGENERIC.
解法,先暫時在呼叫mips_machine_setup()的時候給固定的常數
mips_machine_setup(AR71XX_MACH_DIR_825_B1);
這樣就會照著mach-dir-825-b1.c中的dir825b1_setup() 來配置.
下一步應該就是找到prom.c中的board變數是怎麼弄的......
希望對研究openWRT的人有幫助.
你好,我最近也用公板 AP96 在裝 OpenWRT,我的方法是 Build 完 DIR-825 的 Profile 後,在
bootargs 多加一個 board=DIR-825-B1 的參數即可讓 openWRT 辯認為 DIR-825,只是還是無法順
利開機,會出現一堆 jffs2 的錯誤訊息 Orz...
離線
#4 2009-12-30 15:04:33
Re: [OpenWRT] Can not mount rootfs.
一堆jffs2的錯誤訊息應該是partition不對的關係吧??
你有修改過mach-dir-825-b1.c中partition的配置嗎??
我現在的配置是
0x000000000000-0x000000030000 : "uboot"
0x000000030000-0x000000040000 : "config"
0x000000040000-0x000000640000 : "rootfs"
0x000000640000-0x0000007f0000 : "vmlinux"
0x0000007f0000-0x000000800000 : "caldata"
另外,DIR-825的caldata位置也跟公版不一樣,所以也要改掉
要不然PCI會report 168C:001D的ID,這樣Driver就抓不到.
另外就是似乎還沒有AR8316的Driver..........
離線
#7 2010-01-27 13:39:53
Re: [OpenWRT] Can not mount rootfs.
以下是我運行時的信息,請各位幫忙看一下,認出了mtd分區,但是無法mount文件系統(squashfs)!
RedBoot>
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xBF000000 0xBF000000 0x00040000 0x00000000
vmlinux 0xBF040000 0x80060000 0x00120000 0x8029E000
filesystem 0xBF160000 0x8029E000 0x00600000 0x00000000
FIS directory 0xBF7E0000 0xBF7E0000 0x0000F000 0x00000000
RedBoot config 0xBF7EF000 0xBF7EF000 0x00001000 0x00000000
RedBoot>
+VSC8601: did not find unit 1
Ethernet eth0: MAC address 00:03:7f:ff:ff:fe
IP: 192.168.15.77/255.255.255.0, Gateway: 192.168.15.254
Default server: 192.168.15.30
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version UNKNOWN - built 16:18:32, Oct 20 2009
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Board: pb44
RAM: 0x80000000-0x84000000, [0x80050c00-0x80fe1000] available
FLASH: 0xbf000000 - 0xbf7f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
RedBoot> fis load -l vmlinux
Image loaded from 0x80060000-0x80281200
RedBoot> exec 0x80060000
Now booting linux kernel:
Base address 0x80050000 Entry 0x80060000
Cmdline : console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init
Linux version 2.6.30.9 (root@linux-n8bz) (collect2: ld returned 1 exit status) #17 Tue Jan 26 21:33:50 CST 2010
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2, CPU:600.000 MHz, AHB:150.000 MHz, DDR:300.000 MHz
Determined physical RAM map:
memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=PB44 console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init ethaddr=00.03.7f.ff.ff.fe
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00040102
Readback ErrCtl register=00040102
NR_IRQS:56
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 62236k/65536k available (1743k kernel code, 3224k reserved, 315k data, 124k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 399.76 BogoMIPS (lpj=1998848)
Mount-cache hash table entries: 512
net_namespace: 528 bytes
NET: Registered protocol family 16
MIPS: machine is Atheros PB44
registering PCI controller with io_map_base unset
bio: create slab at 0
pcf857x 0-0020: gpios 16..31 on a pcf8575
i2c-gpio i2c-gpio.0: using pins 1 (SDA) and 0 (SCL)
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
pci 0000:00:11.0: PME# supported from D0 D3hot
pci 0000:00:11.0: PME# disabled
PCI: mapping irq 48 to pin1@0000:00:11.0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
msgmni has been set to 121
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: w25x64 (8192 Kbytes)
Searching for RedBoot partition table in spi0.0 at offset 0x7e0000
6 RedBoot partitions found on MTD device spi0.0
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "RedBoot"
0x000000040000-0x000000160000 : "vmlinux"
0x000000160000-0x000000760000 : "filesystem"
0x0000007e0000-0x0000007ef000 : "FIS directory"
0x0000007ef000-0x0000007f0000 : "RedBoot config"
0x0000007f0000-0x000000800000 : "boardconfig"
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear
All bugs added by David S. Miller
VFS: Cannot open root device "31:02" or unknown-block(31,2)
Please append a correct "root=" boot option; here are the available partitions:
1f00 256 mtdblock0 driver: m25p80
1f01 1152 mtdblock1 driver: m25p80
1f02 6144 mtdblock2 driver: m25p80
1f03 60 mtdblock3 driver: m25p80
1f04 4 mtdblock4 driver: m25p80
1f05 64 mtdblock5 driver: m25p80
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
離線
#8 2010-02-26 16:02:40
Re: [OpenWRT] Can not mount rootfs.
Hello 這個問題不知道你解決沒有,我想過一個月了應該是解決了。
不過還是回一下。
如果你的Kernel + rootfs 都是 openwrt 做出來的,
kernel 和 rootfs 有 default 的 partition name.
那你應該要用 redboot 的命令把 "vmlinux" partition name 改成 kernel, filesystem 改成 rootfs
再try 一下。Thanks
MagusBoy 提到:
以下是我運行時的信息,請各位幫忙看一下,認出了mtd分區,但是無法mount文件系統(squashfs)!
RedBoot> RedBoot> fis list Name FLASH addr Mem addr Length Entry point RedBoot 0xBF000000 0xBF000000 0x00040000 0x00000000 vmlinux 0xBF040000 0x80060000 0x00120000 0x8029E000 filesystem 0xBF160000 0x8029E000 0x00600000 0x00000000 FIS directory 0xBF7E0000 0xBF7E0000 0x0000F000 0x00000000 RedBoot config 0xBF7EF000 0xBF7EF000 0x00001000 0x00000000 RedBoot> [ deleted ... ] VFS: Cannot open root device "31:02" or unknown-block(31,2) Please append a correct "root=" boot option; here are the available partitions: 1f00 256 mtdblock0 driver: m25p80 1f01 1152 mtdblock1 driver: m25p80 1f02 6144 mtdblock2 driver: m25p80 1f03 60 mtdblock3 driver: m25p80 1f04 4 mtdblock4 driver: m25p80 1f05 64 mtdblock5 driver: m25p80 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
離線
相關討論主題
主題 | 回覆 | 點閱 | 最後發表 |
---|---|---|---|
openwrt 破解WIFI 作者 zhengguowang132
|
0 | 11876 | 2017-10-20 18:12:09 作者 zhengguowang132 |
|
11 | 33510 | 2017-01-15 08:56:27 作者 bug2000 |
1 | 11868 | 2013-05-24 07:21:37 作者 hippo | |
[OpenWRT] Attitude Adjustment (12.09-beta) 作者 changeway
|
1 | 15969 | 2012-12-07 15:35:22 作者 changeway |
[OpenWRT]讓你的Router支援WiMAX 網卡(CDC)! 作者 changeway
|
2 | 17479 | 2012-11-01 09:30:35 作者 changeway |