平台:海思hi3716c linux kernel:3.0.8 rootfs: mer-core based on release 20121018.1 使用下面的bootargs:
setenv bootargs 'mem=764M vmalloc=600Mconsole=ttyAMA0,115200 mmz=ddr,0,0xb3c00000,100M mtdparts=hi_sfc:448K(fastboot),64K(bootargs),3520K(recovery),64K(deviceinfo);hinand:6M(baseparam),8M(logo),10M(fastplay),30M(cache),10M(misc),10M(kernel),300M(system),134M(userdata),4M(blackbox),1536M(sdcard)root=/dev/nfs rw nfsroot=192.168.188.141:/home/zhanghui/nfs/rootfs/mer-hybris ip=dhcp'
问题1: VFS: Cannot open root device"nfs" or unknown-block(0,255) Pleaseappend a correct "root=" boot option; here are the availablepartitions:原因是:kernel中的NFS支持没设置好。 解决办法:
理论上说,要用NFS启动rootfs,需要有两个支持: (1)NFSv3 client support (2)Root file system on NFS 但是,在hi3716c的kernel目录下,'make menuconfig'时死活没有看到"Root file system on NFS"这个选项。 网上查到"Root file system on NFS"对应的是"CONFIG_ROOT_NFS",于是 #vim arch/arm/configs/godbox_icsmer_defconfig 在上面的文件加入"CONFIG_ROOT_NFS=y"。 然后执行: #make godbox_icsmer_defconfig 查看.config文件,发现并没有“CONFIG_ROOT_NFS”这个东东。表明没有生效。 找到链接http:///lkddb/web-lkddb/ROOT_NFS.html,里面有描述: Root file system on NFS found in fs/nfs/Kconfig The configuration item CONFIG_ROOT_NFS: 原来依赖了CONFIG_IP_PNP。于是, #vim arch/arm/configs/godbox_icsmer_defconfig 设置"CONFIG_IP_PNG=y" #make godbox_icsmer_defconfig 检查生成的.config文件,发现CONFIG_ROOT_NFS=y已经在里面了。 #make -j 8 uImage
将生成的内核arch/arm/boot/uImage烧写入FLASH,重启系统。
问题2
在问题1解决后,碰到错误信息: IP-Config: Incomplete network configurationinformation. VFS: Unable to mount root fs via NFS,trying floppy. VFS: Cannot open root device"nfs" or unknown-block(2,0) Pleaseappend a correct "root=" boot option; here are the availablepartitions: 查看kernel/net/ipv4/ipconfig.c,发现有几行代码:/* * If none of DHCP/BOOTP/RARP was selected, return with an error. * This routine gets only called when some pieces of information * are missing, and without DHCP/BOOTP/RARP we are unable to get it. */ if (!ic_proto_enabled) { printk(KERN_ERR "IP-Config: Incomplete network configuration information.\n"); return -1; }
从这里看,应该至少使能DHCP/BOOTP/RARP中的一个;检查godbox_icsmer_defconfig发现,这三个东东没有。 因此, #vim arch/arm/configs/godbox_icsmer_defconfig 在其中添加三行: CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_RARP=y 然后, #make godbox_icsmer_defconfig
#make -j 8 uImage
将生成的内核arch/arm/boot/uImage烧写入FLASH,重启系统。 问题3: 还有一个没有搞明白的问题。虽然现在用DHCP获取IP可以通过NFS挂载ROOTFS了,但如果在bootargs中改用静态IP,怎么也不行,总是打印"Sending DHCP request"。不知为什么。 开发板进入linux后,设置ip和gateway ifconfig eth0 down ifconfig eth0 up ifconfig eth0 192.168.1.230 route add default gw 192.168.1.1 手动挂载rootfs mount -t nfs -o nolock -o tcp 192.168.1.165:/home/rootfs /mnt
|