一安裝nfs
前面的博客裏有講
二 配置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(網卡設備名稱)