参考资料 : http://www.cnblogs.com/cjjnjust/articles/1754849.html
一、uboot下的网络调试设置参数
1、配置nfs根文件系统参数
setenv bootargs "noinitrd console=ttySAC0,115200 mem=64M init=/linuxrc root=/dev/nfs rw nfsroot=192.168.0.104:/home/smb/uboot_kernel/rootfs_20150417 ip=192.168.0.110:192.168.0.104:192.168.0.1:255.255.255.0"
setenv bootargs "noinitrd console=ttySAC0,115200 mem=64M init=/linuxrc root=/dev/nfs rw nfsroot=192.168.0.104:/home/smb/uboot_kernel/rootfs_20150417,intr,nolock,proto=tcp,nfsvers=3 ip=192.168.0.110:192.168.0.104:192.168.0.1:255.255.255.0:root:eth0:off"
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
nfsroot=192.168.0.101:/home/smb/uboot_kernel/rootfs_20150417,intr,nolock,proto=tcp,nfsvers=3
nfsaddrs = <my-ip> : <serv-ip> : <gw-ip> : <netmask> :<name>:<dev>:<auto>
ip = 192.168.0.240:192.168.1.200:192.168.1.1:255.255.255.0: xlpc : eth0: off
开启host nfs服务
测试是否可用 : mount -t nfs -o nolock 192.168.0.104:/home/smb/uboot_kernel/rootfs_20150417 /mnt
2、配置从tftp下载内核
setenv bootcmd 'tftp 0x30008000 uImage;bootm 0x30008000'
3、启动内核
run bootcmd
二、内核选项
File systems --->
Network File Systems --->
<*> NFS file system support ## 必选
[*] Provide NFSv3 client support ## 可选
[*] Root file system on NFS ## 必选
Networking --->
[*] Networking support
Networking options --->
[*] IP: kernel level autoconfiguration ## 必选
三、内核挂载nfs根文件系统代码流程
经过分析,内核挂载nfs根文件系统,不依赖于uboot下的网络配置,在内核启动过程中,内核会重新初始化网卡及网络配置,内核挂载nfs根文件系统只需要uboot下的向内核传递的nfs挂载根文件系统的相关参数
4、x86下nfs挂载根文件系统可行性分析
经上面的分析,内核挂载根文件系统,不依赖与uboot下的网络设置,因此,在X86环境下,也不需要BIOS/grub下相关网络能通。经验证,只需需改grub.cfg,即可达到x86下nfs挂载根文件系统的效果
menuentry 'x86 nfs debug'{
linuxefi /bzImage root=/dev/nfs rw nfsroot=10.5.33.253:/home/test/rootfs,intr,nolock,proto=tcp,nfsvers=3 ip=10.5.33.87:10.5.33.253:10.5.33.254:255.255.255.0:root:eth0:off console=ttyS0,115200n81
}
本文档介绍了如何在ARM和X86平台上通过NFS挂载根文件系统进行调试。主要内容包括在U-Boot中配置NFS参数,设置从TFTP下载内核,内核的NFS支持选项,以及X86环境下NFS挂载的实现方法。在X86环境下,只需修改GRUB配置文件即可实现NFS根文件系统的挂载。
692

被折叠的 条评论
为什么被折叠?



