在Ubuntu中搭建nfs服务,使用X210开发板在uboot中用nfs加载系统测试

1.注意事项

  • 注意Winshared文件夹由于权限问题,不能作为服务器地址使用

2.安装相关应用

  • sudo apt-get install nfs-kernel-server,安装服务器

3.建立服务器目录

  • mkdir ~/nfs # 这是建立tftp传输目录。
  • sudo chmod 0777 ~/nfs #修改权限

4.配置/etc/exports

  • sudo vi /etc/exports
  • *:所有用户均可连接
  • rw:挂接此目录的客户端对该共享目录具有读写权限
  • sync:资料同步写入内存和硬盘
  • no_root_squash:root用户具有对根目录的完全管理访问权限。
  • no_subtree_check:不检查父目录的权限。
/home/shine/nfs *(rw,sync,no_subtree_check)                                         

5.配置nfs-kernel-server

  • 由于u-boot的nfs是2.0版本的,要修改配置文件使其支持
  • 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"

6.加载到一半出现ERROR: Cannot umount

  • 修改 /etc/hosts 中添加开发板的IP地址(192.168.1.88是我的开发板的地址)
  • 192.168.1.88 x210
  • 关闭ubuntu防火墙
  • sudo ufw disable #关闭防火墙
  • sudo ufw enable #开启防火墙
  • sudo ufw status #检查防火墙的状态

7.重启服务

按以下顺序重启

  • sudo /etc/init.d/portmap restart # 重启portmap服务
  • sudo /etc/init.d/nfs-kernel-server restart # 重启nfs服务

8.在u-boot中配置网络

  • 在开发板进入uboot后修改如下内容
    ipaddr=192.168.1.88
    serverip=192.168.1.16
    gatewayip=192.168.1.1
    netmask=255.255.255.0
  • 修改完成后,ping192.168.1.118,检测网络是否正常

9.下载镜像到DDR中启动

  • 将zImage-qt放入设写的tftp目录中
  • 在u-boot中执行 nfs 30008000 192.168.1.118:/home/shine/nfs/zImage-qt,将镜像下载到DDR中
  • 执行bootm 0x30008000,进入系统
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值