急需帮助!Linux系统移植的问题:Failed to execute /linuxrc. Attempting defaults...

时间:2021-10-08 07:46:58
   今天移植linux内核(3.0.1),一直没有成功,想请高手们指教一下。就是移植之后,系统启动出现了这么一句话:Failed to execute /linuxrc.  Attempting defaults...,然后无法执行下去了。

   我上网搜索了好久,发现很多人遇到过这个问题,但是我也发现很多人的错误原因都不相同,参考起来还挺费劲的,觉得挺苦恼的。

   先排除某些情况吧,不是linuxrc的问题,烧写分区也没错,mkyaffs2image制作也没问题(我使用的是yaffs2文件系统),文件系统是没有问题的,因为我用其他已经生成的Kernel烧写进去,设备能够正常进入交互界面。也不是bootloader的问题,那么就是可以肯定是我编译的内核的问题了!

   内核配置方面:
   Miscellaneous filesystems选项中,yaffs2 file system support已打上*号,并选上Autoselect yaffs2 format和Disable yaffs from doing ECC on tags by default。
   Boot Option选项内容为noinitrd root=/dev/mtdblock2 rootfstype=yaffs2 init=/linuxrc console=ttySAC0,115200。其中我的文件系统放在第3个分区。

   然后是Device Driver->MTD->caching block device ...
                          ->nand device support -> 等等,网速不好,上不了图,只好手写啦!但是我觉得问题应该跟这个没关系,因为看调试信息知道文件系统已经挂载上去了,只是无法执行/linuxrc,还是我漏了什么呢?对内核配置不熟啊!恳请大家指点指点。

   写得有点多了,但是我只想提供多点信息出来,好让各位朋友,各位高手帮我对症下药,有点啰嗦,请见谅啦!已经头痛了一天,急需救援!!!谢谢大家!!!定感激不尽!!!
   
下面是启动过程调试信息片段:
--------------------------------------------------------------------------------
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 3.0.1 (root@chenhuashang) (gcc version 4.4.3 (ctng-1.6.1) ) #3 Sun Sep 15 15:02:03 CST 2013
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OK6410
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
camera: no parent clock specified
S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
mout_apll: source is fout_apll (1), rate is 532000000
mout_epll: source is epll (1), rate is 24000000
mout_mpll: source is mpll (1), rate is 532000000
mmc_bus: source is mout_epll (0), rate is 24000000
mmc_bus: source is mout_epll (0), rate is 24000000
mmc_bus: source is mout_epll (0), rate is 24000000
usb-bus-host: source is clk_48m (0), rate is 48000000
uclk1: source is dout_mpll (1), rate is 66500000
spi-bus: source is mout_epll (0), rate is 24000000
spi-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
irda-bus: source is mout_epll (0), rate is 24000000
camera: no parent clock specified
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: root=/dev/mtdblock2 rootfstype=yaffs2 init=/linuxrc console=ttySAC0,115200
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB = 256MB total
Memory: 256884k/256884k available, 5260k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xff600000 - 0xffe00000   (   8 MB)
    vmalloc : 0xd0800000 - 0xf6000000   ( 600 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0023000   ( 108 kB)
      .text : 0xc0023000 - 0xc028b454   (2466 kB)
      .data : 0xc028c000 - 0xc02b0a20   ( 147 kB)
       .bss : 0xc02b0a44 - 0xc02e1818   ( 196 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:246
VIC @f6000000: id 0x00041192, vendor 0x41
VIC @f6010000: id 0x00041192, vendor 0x41
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 528.79 BogoMIPS (lpj=2643968)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
MINI6410: Option string ok6410=0
MINI6410: selected LCD display is 480x272
s3c64xx_dma_init: Registering DMA channels
PL080: IRQ 73, at d0804000, channels 0..8
PL080: IRQ 74, at d0806000, channels 8..16
S3C6410: Initialising architecture
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
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
start plist test
end plist test
s3c-fb s3c-fb: window 0: fb 
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 16) is a S3C6400/10
s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 20) is a S3C6400/10
s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 24) is a S3C6400/10
s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 28) is a S3C6400/10
brd: module loaded
loop: module loaded
S3C NAND Driver, (c) 2008 Samsung Electronics
NandFlash is busying.........
forlinx nandflash dev_id=d7
forlinx****Nandflash:ChipType= MLC  ChipName=samsung-K9LBG08U0D************ 
S3C NAND Driver is using hardware ECC.
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit)
Creating 4 MTD partitions on "NAND 4GiB 3,3V 8-bit":
0x000000000000-0x000000200000 : "Bootloader"
0x000000200000-0x000000700000 : "Kernel"
0x000000700000-0x00000cf00000 : "File System"
0x00000cf00000-0x000100000000 : "User"
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 79, io mem 0x74300000
s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
ohci_hcd: can't start s3c24xx
s3c2410-ohci s3c2410-ohci: startup error -75
s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered
s3c2410-ohci: probe of s3c2410-ohci failed with error -75
mousedev: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (24000000 Hz)
mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
s3c-sdhci s3c-sdhci.1: clock source 0: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.1: clock source 1: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.1: clock source 2: mmc_bus (24000000 Hz)
mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc1: SDHCI controller on samsung-hsmmc [s3c-sdhci.1] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz
mmc0: mmc_rescan_try_freq: trying to init card at 200000 Hz
mmc0: mmc_rescan_try_freq: trying to init card at 100000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 300000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 200000 Hz
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
Freeing init memory: 108K
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[<c002e950>] (unwind_backtrace+0x0/0xf4) from [<c01e7ba0>] (panic+0x58/0x178)
[<c01e7ba0>] (panic+0x58/0x178) from [<c002357c>] (init_post+0x7c/0xcc)
[<c002357c>] (init_post+0x7c/0xcc) from [<c0008458>] (kernel_init+0xe8/0x118)
[<c0008458>] (kernel_init+0xe8/0x118) from [<c0029f38>] (kernel_thread_exit+0x0/0x8)
-----------------------------------------------------------------------------------

9 个解决方案

#1


几个可以排查的点
1. 尝试NFS启动,然后mount flash上的rootfs,看flash上的rootfs是不是好的
2. 其他已经编译的kernel是和这个kernel用同一个版本编译器吗

#2


mkyaffs2image 这个工具有问题把?比如MINI2440 的nandflash是 256M的 那么所用的Image生成工具比如用mkyaffs2image-128  不然也会出现你上述的问题 

#3


引用 2 楼 kavy00 的回复:
mkyaffs2image 这个工具有问题把?比如MINI2440 的nandflash是 256M的 那么所用的Image生成工具比如用mkyaffs2image-128  不然也会出现你上述的问题 
不是啊,你看我上面都说了,用了其他内核烧写时,是没有问题的!

#4


引用 3 楼 chenhuashang 的回复:
Quote: 引用 2 楼 kavy00 的回复:

mkyaffs2image 这个工具有问题把?比如MINI2440 的nandflash是 256M的 那么所用的Image生成工具比如用mkyaffs2image-128  不然也会出现你上述的问题 
不是啊,你看我上面都说了,用了其他内核烧写时,是没有问题的!

与其他好的内核对比下配置看看  就是 make menuconfig 的配置 

#5


按照错误提示应当是启动的init参数没有设置对,比如启动内存地址之类的,要和bootloader中的一致

#6


尝试检查你的flash分区对不对

#7


请问这个问题您解决了弄懂了么?我现在遇到完全和你一模一样的问题!自带的uImage可以挂载根文件系统进入控制台界面,但是自己跟着手册一步一步移植的就是不行,也是Failed to execute /linuxrc

#8


今天遇到这个问题

换了自己编译的uboot 解决了

#9


请问您这个问题解决了吗?我也是同样的问题,而且网上好多人都遇上了这个问题,是不是u-boot和kernel的某个地址不匹配造成的呢?

#1


几个可以排查的点
1. 尝试NFS启动,然后mount flash上的rootfs,看flash上的rootfs是不是好的
2. 其他已经编译的kernel是和这个kernel用同一个版本编译器吗

#2


mkyaffs2image 这个工具有问题把?比如MINI2440 的nandflash是 256M的 那么所用的Image生成工具比如用mkyaffs2image-128  不然也会出现你上述的问题 

#3


引用 2 楼 kavy00 的回复:
mkyaffs2image 这个工具有问题把?比如MINI2440 的nandflash是 256M的 那么所用的Image生成工具比如用mkyaffs2image-128  不然也会出现你上述的问题 
不是啊,你看我上面都说了,用了其他内核烧写时,是没有问题的!

#4


引用 3 楼 chenhuashang 的回复:
Quote: 引用 2 楼 kavy00 的回复:

mkyaffs2image 这个工具有问题把?比如MINI2440 的nandflash是 256M的 那么所用的Image生成工具比如用mkyaffs2image-128  不然也会出现你上述的问题 
不是啊,你看我上面都说了,用了其他内核烧写时,是没有问题的!

与其他好的内核对比下配置看看  就是 make menuconfig 的配置 

#5


按照错误提示应当是启动的init参数没有设置对,比如启动内存地址之类的,要和bootloader中的一致

#6


尝试检查你的flash分区对不对

#7


请问这个问题您解决了弄懂了么?我现在遇到完全和你一模一样的问题!自带的uImage可以挂载根文件系统进入控制台界面,但是自己跟着手册一步一步移植的就是不行,也是Failed to execute /linuxrc

#8


今天遇到这个问题

换了自己编译的uboot 解决了

#9


请问您这个问题解决了吗?我也是同样的问题,而且网上好多人都遇上了这个问题,是不是u-boot和kernel的某个地址不匹配造成的呢?