kernel panic
(阿安, 2012-09-19 18:18)
1樓
最近在移值kernel到ARM9上,當開機後會秀出下面錯誤訊息
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 524KiB [1 disk] into ram disk... done.
VFS: Mounted root (cramfs filesystem) readonly on device 1:0.
Freeing init memory: 172K
Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
上網查後,確認linuxrc有執行權限且路徑也正確,busybox也有執行權限,kernel也支援ramdisk和cramfs
這問題困擾我好幾個禮拜,在想是不是系統mount filesystem失敗,導致找不到linuxrc
要怎樣確認是否成功mount filesystem
下面是uboot相關參數設定
bootcmd=sf probe 0;sf read 0x82000000 0x100000 0x400000;sf probe 0;sf read 0x82400000 0x500000 0x100000;bootm 0x82000000 0x82400000
bootargs=mem=64M console=ttyAMA0,115200 root=/dev/ram0 rw rootfstype=cramfs mtdparts=hi_sfc:1M(boot),4M(kernel),1M(ramdisk),7M(custom),1M(jffs2),2M(other)
雖然bootargs沒指定init,但程式會確認依序執行/sbin/init、/bin/init,而我也確認init是有執行權限的
當程式嘗試完所有init後,都失敗才會出現錯誤訊息
但不解的是,都有檔案,且都是ARM型態並不是i386
請老師指教~
(RAY, 2012-09-19 23:23)
2樓
很有可能你的init的程式,已不在/dev/ram0 ,
你先不用要RAM DISK, 試一下,看情況如何.
如果OK.在回頭看RAM DISK. 的情況
(阿安, 2012-09-20 15:51)
3樓
拿掉ramdisk,更改u boot參數如下:
bootargs=mem=64M console=ttyAMA0,115200 root=31:2 rw noinitrd init=/linuxrc rootfstype=cramfs mtdparts=hi_sfc:1M(boot),4M(kernel),1M(ramdisk),7M(custom),1M(jffs2),2M(other)
bootcmd=sf probe 0;sf read 0x82000000 0x100000 0x400000;bootm 0x82000000
依舊出現下面錯誤:
VFS: Mounted root (cramfs filesystem) readonly on device 31:2.
Freeing init memory: 172K
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.
百思不得其解..
(阿安, 2012-09-28 11:28)
4樓
問題解決囉~
很簡單,只要把busybox用靜態編譯就可以了..
不過造成panic得原因很多,我想我解決的方法只是其中一種..
謝囉~