一安装nfs
apt-get install nfs-kernel-server
二 配置nfs
yelei@ubuntu:~$ sudo dpkg-reconfigure portmap (对Should portmap be bound to the loopback address? 选N)
yelei@ubuntu:~$ sudo gedit /etc/default/portmap (清除 "-i 127.0.0.1")
三 配置hosts.deny
yelei@ubuntu:~$ sudo gedit /etc/host.deny
文本末添加:
portmap: ALL
lockd: ALL
mountd: ALL
rquotad: ALL
statd: ALL
四 配置hosts.allow
yelei@ubuntu:~$ sudo gedit /etc/host.allow
文本末加入:
portmap:192.168.1.
lockd:192.168.1.
rquotad:192.168.1.
mountd:192.168.1.
statd:192.168.1.
yelei@ubuntu:~$ sudo /etc/init.d/portmap restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service portmap restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart portmap
portmap start/running, process 5399
五 配置/etc/exports
yelei@ubuntu:~$ sudo/gedit /etc/exports
/home/yelei/filesys/rootfs *(rw,sync,no_subtree_check)
yelei@ubuntu:~$ sudo /etc/init.d/nfs-kernel-server restart
* Stopping NFS kernel daemon [ OK ]
* Unexporting directories for NFS kernel daemon... [ OK ]
* Exporting directories for NFS kernel daemon... [ OK ]
* Starting NFS kernel daemon [ OK ]
yelei@ubuntu:~$ sudo showmount -e
Export list for ubuntu:
/home/yelei/filesys/rootfs *
六 板卡参数设置
setenv bootargs mem=128M console=ttyS2,115200n8 root=/dev/nfs nfsroot=192.168.1.146:/home/yelei/filesys/rootfs ip=192.168.1.200:192.168.1.146:192.168.1.1:255.255.255.0::eth0:off
saveenv
即可
这里解释一下参数
"nfsroot=" 后面是我NFS主机的IP地址和我的文件系统的路径, 上面说过
"ip="后面
一 目标板IP 192.168.0.5(我的启动参数里print给大家了,就是ipaddr)
二 主机IP 192.168.0.3
三 目标板网关 192.168.0.1
四 子网掩码 255.255.255.0
五 开发板名字(随你便)没有名字用:代替
六 eth0(网卡设备名称)