1.Ubuntu安装 NFS 服务
sudo apt-get install nfs-kernel-server
2.打开 nfs 配置文件/etc/exports
sudo vi /etc/exports
3.打开/etc/exports 以后在后面添加如下所示内容(注“:wq!”强制保存退出)
/home/user/linux/nfs *(rw,sync,no_root_squash)
4.nfs下载失败有可能是Ubuntu的nfs版本高于uboot的nfs版本,在Ubuntu中指定nfs的版本兼容uboot的版本
输入下面的命令:
sudo vim /etc/default/nfs-kernel-server
更改里面的内容(注意填写正确)
# Number of servers to start up
#RPCNFSDCOUNT=8
RPCNFSDCOUNT="-V 2 8"
# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0
# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
#RPCMOUNTDOPTS="--manage-gids"
RPCMOUNTDOPTS="-V 2 --manage-gids"
# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""
# Options for rpc.svcgssd.
#RPCSVCGSSDOPTS=""
RPCSVCGSSDOPTS="--nfs-version 2,3,4 --debug --syslog"
5.打开并且修改nfs配置文件!!
sudo vi /etc/nfs.conf
找到[nfsd],修改如下:(注“:wq!”强制保存退出)
[nfsd]
51 # debug=0
52 # threads=8
53 # host=
54 # port=0
55 # grace-time=90
56 # lease-time=90
57 udp=y
58 tcp=y
59 vers2=y
60 # vers3=y
61 # vers4=y
62 # vers4.0=y
63 # vers4.1=y
64 # vers4.2=y
65 # rdma=n
66 # rdma-port=20049
67 #
6.关闭防火墙
sudo ufw disable
7.重启nfs server
sudo /etc/init.d/nfs-kernel-server restart
8.开始尝试在uboot下下载内核数据 先ping一下Ubuntu系统的ip地址,确认连接后可进行nfs下载内核数据
=> nfs 80800000 192.168.0.105:/home/imx6ull/nfs/zImage
Using ethernet@20b4000 device
File transfer via NFS from server 192.168.0.105; our IP address is 192.168.0.118
Filename '/home/imx6ull/nfs/zImage'.
Load address: 0x80800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##########################
done
Bytes transferred = 6785360 (678950 hex)