mini2440 内核移植之后挂载根文件系统提示:Failed to execute /linuxrc. Attempting defaults...

时间:2023-02-05 16:31:39
这两天完全按照友善之臂mini2440的内核移植手册一步一步的移植了内核linux-2.6.32.2,然后尝试着挂载友善光盘里已经搭建好的根文件系统,然后出现如下启动界面:
NAND read: device 0 offset 0x60000, size 0x500000
 5242880 bytes read: OK
## Booting kernel from Legacy Image at 30008000 ...
   Image Name:   linux-2.6.32.2 by LiHao
   Created:      2014-07-22  14:07:47 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2098068 Bytes =  2 MB
   Load Address: 30008000
   Entry Point:  30008040
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.................................................................................................................................... done, booting the kernel.
Linux version 2.6.32.2 (root@embedclub) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #3 Tue Jul 22 22:07:13 CST 2014
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: FriendlyARM MINI2440 development board
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 60492KB available (3680K code, 418K data, 132K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:85
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c: slave address 0x10
s3c-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
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
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 118
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 60x53
fb0: s3c2410fb frame buffer device
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
s3c24xx-nand s3c2440-nand: NAND hardware ECC
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1049 at 0x000008320000
Bad eraseblock 2012 at 0x00000fb80000
Creating 5 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "U-boot"
ftl_cs: FTL header not found.
0x000000040000-0x000000060000 : "param"
0x000000060000-0x000000560000 : "Kernel"
0x000000560000-0x000040560000 : "root"
mtd: partition "root" extends beyond the end of device "NAND 256MiB 3,3V 8-bit" -- size truncated to 0xfaa0000
0x000000000000-0x000040000000 : "nand"
mtd: partition "nand" extends beyond the end of device "NAND 256MiB 3,3V 8-bit" -- size truncated to 0x10000000
dm9000 Ethernet Driver, V1.31
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
cpuidle: using governor ladder
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.21.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
VFS: Mounted root (yaffs filesystem) on device 31:3.
Freeing init memory: 132K
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

[<c002fd34>] (unwind_backtrace+0x0/0xdc) from [<c02e25f0>] (panic+0x40/0x120)
[<c02e25f0>] (panic+0x40/0x120) from [<c00295b4>] (init_post+0xcc/0xf4)
[<c00295b4>] (init_post+0xcc/0xf4) from [<c0008440>] (kernel_init+0xdc/0x10c)
[<c0008440>] (kernel_init+0xdc/0x10c) from [<c002ae54>] (kernel_thread_exit+0x0/0x8)

看提示应该是挂载根文件系统时找不到/linuxrc这个文件引起的内核恐慌,于是我用光盘里提供的已经移植好的内核uImage挂载同样的根文件系统,发现是可以顺利进入控制台界面的,所以我非常好奇,应该说根文件系统搭建这一块应该没有问题,难道是内核移植这块出现的问题?但是内核的移植完全是按照移植手册来的,百思不得其解,希望有大牛能指点迷津,感激不尽!

6 个解决方案

#1


能正常挂载的uimage的系统日志和你的相比有什么区别么?能不能对比一下。

#4


文件系统里面的库 有版本限制,不能太高,我遇到同样的问题,过了很久才解决这个问题。

#5


引用 2 楼 zhxianbin 的回复:
http://qiuye.iteye.com/blog/543595


参考该blog分析:

Creating 5 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "U-boot"
ftl_cs: FTL header not found.   //这个是什么?
0x000000040000-0x000000060000 : "param"
0x000000060000-0x000000560000 : "Kernel"
0x000000560000-0x000040560000 : "root"   
mtd: partition "root" extends beyond the end of device "NAND 256MiB 3,3V 8-bit" -- size truncated to 0xfaa0000
0x000000000000-0x000040000000 : "nand"  //这个告诉我们,root size不对,越界了0x400,0000都有1GB大小了,这个NAND是256MB的
mtd: partition "nand" extends beyond the end of device "NAND 256MiB 3,3V 8-bit" -- size truncated to 0x10000000


你的uimage是不是拷贝到正确的Flash位置了?

#6


嗯,,我来看看,,挺好。

#1


能正常挂载的uimage的系统日志和你的相比有什么区别么?能不能对比一下。

#2


#3


#4


文件系统里面的库 有版本限制,不能太高,我遇到同样的问题,过了很久才解决这个问题。

#5


引用 2 楼 zhxianbin 的回复:
http://qiuye.iteye.com/blog/543595


参考该blog分析:

Creating 5 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "U-boot"
ftl_cs: FTL header not found.   //这个是什么?
0x000000040000-0x000000060000 : "param"
0x000000060000-0x000000560000 : "Kernel"
0x000000560000-0x000040560000 : "root"   
mtd: partition "root" extends beyond the end of device "NAND 256MiB 3,3V 8-bit" -- size truncated to 0xfaa0000
0x000000000000-0x000040000000 : "nand"  //这个告诉我们,root size不对,越界了0x400,0000都有1GB大小了,这个NAND是256MB的
mtd: partition "nand" extends beyond the end of device "NAND 256MiB 3,3V 8-bit" -- size truncated to 0x10000000


你的uimage是不是拷贝到正确的Flash位置了?

#6


嗯,,我来看看,,挺好。