uboot与NFS
挣扎了两三天,一个是弄Uboot,一个是制作内核映像,然后用NFS挂载。
以开始弄uboot就觉得奇怪,用光盘里的uboot发现网络连不上,连上网线网卡还是没反应,主机的本地连接也是断开的。原来uboot默认是没有网络访问的,所以它是断开的,如果用ping命令,就会发现网络是通的。具体的网络代码我还没有分析,后面再瞧瞧。
修改uboot代码时,注意在/include/asm-arm/mach-types.h文件中,#define MACH_TYPE_S3C2440 的值,应该是1999,因为在Linux系统中,查看linux-2.6.29/include/asm/mach-types.h会发现machine ID为1999.
其他的一些信息参考http://www.arm9home.net/read.php?tid-5729.html 中的说明。它里面说的分区表也可以不用修改。
制作内核映像,这个直接用光盘中的linux-2.6.29源代码,主要是配置菜单。设置相关的文件系统,设备驱动等等。
除了.config里面的命令行要做相应的修改,CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.1.24:/home/fs/rootfs ip=192.168.1.230:192.168.1.24:192.168.1.255:255.255.255.0::eth0:off rw console=ttySACO mem=64M"
我遇到的主要问题是uboot中传递给内核的启动参数bootargs,把它的值设置为noinitrd root=/dev/nfs rw nfsroot=192.168.1.24:/home/tekkaman/working/nfs/rootfs
ip=192.168.1.230:192.168.1.24::255.255.255.0 console=ttySAC0,115200 init=/linuxrc mem=64M
不然它会出现
VFS: Mounted root (yaffs filesystem) on device 31:3.
Freeing init memory: 128K
Warning: unable to open an initial console.
Failed to execute /linuxrc. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
的错误。
我认为它的错误应该是没有把这个参数 init=/linuxrc传下去,导致找不到根文件系统。

浙公网安备 33010602011771号