一、Ubuntu上
1、apt install nfs-kernel-server
2、gedit /etc/exports
这个是挂载根文件系统能用的
/home/ppp/rootfs 192.168.123.*(rw,no_root_squash,no_all_squash,sync)
/home/ppp/rootfs 192.168.123.*(insecure,rw,sync,no_subtree_check,no_root_squash)
3、exportfs -a
4、 service nfs-kernel-server restart
二、开发板上
1、挂载文件
mount -t nfs -o nolock 192.168.123.200:/home/ppp/rootfs /mnt/mynfs
umount /mnt/mynfs
2、挂载根文件系统
龙芯启动参数设置为:
setenv bootargs console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.123.220:/home/ppp/rootfs,nolock,proto=tcp,nfsvers=3 init=/linuxrc ip=192.168.123.221::::le:eth0:any