在u-boot 命令行下
uboot环境变量:
- gatewayip=192.168.2.1
- netmask=255.255.255.0
- ipaddr=192.168.2.22
- serverip=192.168.2.27
- image=nfs 31000000 $serverip:/home/enzo/mini2440/uImage
- nfs_dir=/home/enzo/nfsroot/nfs_buildroot
- bootargs=run nfsargs
- bootcmd=run image; run nfsargs; run boot
- nfsargs=setenv bootargs noinitrd root=/dev/nfs rw nfsroot=$serverip:$nfs_dir ip=$ipaddr:$serverip::$netmask console=ttySAC0,115200
定义u-boot传送给linux内核的命令行参数,该命令行指定以网络文件系统作为根文件系统。
其中root=/dev/nfs,并非真的设备,而是一个告诉内核经由网络取得根文件系统的旗标。
参数nfsroot这个参数告诉内核以哪一台机器,哪个目录以及哪个网络文件系统选项作为根文件系统使用。参数的格式如下:
nfsroot=[
如果指令列上没有给定 nfsroot 参数,则将使用‘/tftpboot/%s’预设值。其它选项如下:
port = as given by server portmap daemon
rsize = 1024
wsize = 1024
timeo = 7
retrans = 3
acregmin = 3
acregmax = 60
acdirmin = 30
acdirmax = 60
flags = hard, nointr, noposix, cto, ac
参数nfsaddrs设定网络通讯所需的各种网络接口地址。如果没有给定这个参数,则内核核会试著使用反向地址解析协议以及/或是启动协议(BOOTP)以找出这些参数。其格式如下:
nfsaddrs=
此参数可以作为 nfsaddrs 的参数单独使用(前面没有任何 `:` 字符),这种情况下会使用自动配置。然而,此种情况不能使用 `none’作为值。