環境:linux核心載入自己的製作的檔案系統。
錯誤資訊有以下幾種:
錯誤資訊1:
Root-NFS: Server returned error -5 while mounting /mini2440/rootfs
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00 256 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 5120 mtdblock2 (driver?)
1f03 125568 mtdblock3 (driver?)
1f04 131072 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Backtrace:
[<c00341cc>] (dump_backtrace+0x0/0x10c) from [<c03
錯誤資訊2:
Looking up port of RPC 100003/2 on 192.168.1.149
eth0: link up, 100Mbps, full-duplex, lpa 0xC9E1
Looking up port of RPC 100005/1 on 192.168.1.149
VFS: Mounted root (nfs filesystem) on device 0:11.
Freeing init memory: 156K
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
Backtrace:
[<c00341cc>] (dump_backtrace+0x0/0x10c) from [<c0329b08>] (dump_stack+0x18/0x1c)
r7:00000000 r6:00000000 r5:c001f24c r4:c0481c30
這是我在載入自己的製作的檔案系統的時候出現的錯誤資訊。到網上找了協助。
應該注意以下幾點:
1、確保自己的核心鏡像即uImage或者zImage正確,同時必須確保把鏡像燒寫到正確的地址,如果以nfs方式載入鏡像的話,確保不要超出ram的位址範圍。
2、linux主機上面的nfs服務是否安裝好。nfs的確定可以參見我之前的記錄。
3、linuxrc的許可權問題沒有設為可執行檔,在製作根檔案系統時,最好 chmod 777 linuxrc 一下,以免出現Failed to execute /linuxrc的麻煩。
主要linuxrc檔案的存在不是必須的。在沒有linuxrc的時候busybox使用自己預設的檔案,同時inittab檔案也是非必須的。需要與否要根據自己的製作根檔案系統的方法有關。
Freeing init memory: 156K
Failed to execute /linuxrc. Attempting defaults...為什麼會有這個資訊。
當使用busybox組建檔案系統時,以static方式進行編譯,同時把自動產生的linuxrc檔案刪除了,但是在uboot的bootargs中又其選項init=/linuxrc,因為在核心 main.c中init_post()函數中
if (execute_command) {
run_init_process(execute_command);
printk(KERN_WARNING "Failed to execute %s. Attempting "
"defaults...\n", execute_command);
} 需要執行其檔案/linuxrc。因此沒有此檔案時可以的。
4、在安裝busybox的時候,沒有靜態編譯連結庫。
解決方案,在busybox選項中選擇靜態編譯,或者將交叉編譯器中的lib/目錄下的連結庫 cp到根檔案系統下的 lib/目錄下,這樣做出來的檔案系統往往較大。
5、yaffs2 檔案系統被燒寫到了錯誤的分區。yaffs2 檔案系統檔案系統應燒寫在nand的root分區下。其分區資訊可以到核心原始碼中找到如:
mach-mini2440.c中的static struct mtd_partition friendly_arm_default_nand_part[] 資料 定 義了分區資訊。
6、如果你是用的是uboot,你是否用對了yaffs的燒寫指令,nand write.yaffs 而不是 nand write ,另外你的uboot是否正確修改了yaffs檔案系統的燒寫支援。
7、mkyaffs2image工具 做的是否成功?