安装环境:VMware9.0+Ubuntu12.04
$ sudo apt-get install nfs-kernel-server
$ sudo apt-get install nfs-common
配置/etc/hosts.deny
默认也许是(禁止任何host(主机)能和你的NFS服务器进行NFS连接):
### NFS DAEMONS
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
------ 改为屏蔽上面所有的语句。
配置/etc/hosts.allow
允许那些你想要的主机和你的NFS服务器建立连接,我因为是机顶盒去虚拟机进行连接,下列IP以机顶盒的IP地址为例,允许访问虚拟机NFS服务器。在该文件中添加语句:
### NFS DAEMONS
portmap: 192.168.1
lockd: 192.168.1
rquotad: 192.168.1
mountd: 192.168.1
statd: 192.168.1
另外:也可以指定特定的IP地址(例如:192.168.10.144):
ALL: 192.168.10.144/255.255.255.0
/etc/hosts.deny 和 /etc/hosts.allow 设置对portmap的访问.
配置/etc/exports
NFS挂载目录及权限由/etc/exports文件定义
比如将/home/zy/sk/nfsroot目录让192.168.1.*的IP共享, 则在该文件末尾添加下列语句:
/home/zy/sk/nfsroot 192.168.1.*(rw,sync,no_root_squash) ///
//no_root_squash 此可以保证登陆用户具有root读写权限,否则
//登陆窗口不能验证root,从而无法登陆系统。
/home/zy/sk/nfsroot 192.168.1.0/24(rw,sync,no_subtree_check)
//no_subtree_check 没有root权限读写。无法用root登陆系统
//对192.168.1.*网段的所有站点都开放
/home/zy/sk/nfsroot *(rw,sync,no_subtree_check)
//对所有网段都开放//但是没有root权限
最好加上sync, 否则 $ sudo exportfs -r 时会给出警告, sync是NFS的默认选项.
可重新启用NFS新配置
$ sudo /etc/init.d/portmap restart
$ sudo exportfs -r
$ sudo /etc/init.d/nfs-kernel-server restart
以上为NFS安装过程。
2)在机顶盒上进行操作
ifconfig eth0 0.0.0.0
ifconfig eth0:1 192.168.5.194
route add default gw 192.168.5.250
如果使用ifconfig已经连上网,不需要进行以上步骤
mkdir -p /tmp/nfs
进行挂载
mount -t nfs -o nolock -o tcp 192.168.1.104://home/sk/nfsroot /tmp/nfs
3)在Ubuntu中进行编译环境的配置
在./bashrc文件里添加:
export PATH=$PATH:/home/sk/mipsel-4.4/bin
export SCONSEXTMIPSCOMPATH=/home/sk/mipsel-4.4/bin
编译器路径
/home/zy/opt/toolchains/mipsel-4.4/bin
4)在Ubuntu中进行编译
5)在盒子上运行