NFS服务器
NFS(NetworkFileSystem)基于UDP协议进行传输的应用。主要目的是用来传数据,就像windows的共享文件夹一样。可以提高开饭嵌入式的效率。最小linux系统或较小的系统比较适合用NFS来调试。
- 安装NFS服务
apt install nfs-kernel-server
- 配置/etc/pxports文件,在最后一行添加(注意空格)
/home/minilinux/ *(rw,sync,no_root_squash)
- 重启两个服务
/etc/init.d/rpcbind restart
/etc/init.d/nfs-kernel-server restart
- 整一个busybox的system.img
这部分工作比较繁杂,接下来一一赘述
- 找一份busybox的源码,可以在晚上找,也可以在各类学习板的自带资料里拿来用
点这里跳转到busybox官网 - 下载下来后再ubuntu中解压,然后配置menuconfig,配置过程以及编译过程详见这里
- 上面链接中的最后一步打包工具,大家初次使用的时候如果没有安装,系统会自动提醒你是否要安装android-sdk-ext4-utils,这个时候如果没有经验,建议不要安装,否则会出现
error: build_directory_structure: can't set android permissions - built without android support
这样的错误
然后你在网上一通找,也解决不了这个问题,最好是使用我这里给出的tools,直接在根目录解压,自动会合并文件夹到下面目录中
/uer/local/bin
然后再再解压busybox的位置调用如下命令就可以开始执行打包操作
make_ext4fs -s -l 300M -a root -L linux system.img system
至此镜像做完了
- 配置内核:在linux内核下,make menuconfig,按照如下配置
“Networking support”→“Networking options”→选上“IP: kernel level
autoconfiguration” “File systems”→“Network File Systems” – 选中“NFS
client support”,“NFS client support for NFS version 3”,“NFS client
support for the NFSv3 ACL protocol extension”,“NFS client support for
NFS version4”,“NFS client support for NFSv4.1”,“Root file system on
NFS” “Boot options”→“Default kernel command”
- 最后一个进入上述Default kernel command界面后,如下所示
这里如下填写:
root=/dev/nfs rw nfsroot=192.168.2.159:/home/wly/minilinux/system ip=192.168.2.230:192.168.2.159:192.168.2.1:255.255.255.0:iTOP:eth0:off rootfstype=ext4 init=/linuxrc console=ttySAC2,115200
- 其中:192.168.2.159为ubuntu的地址,192.168.2.230为开发板的地址,另外两个分别为网关和子网掩码。
- 填写完后保存退出,make zImage 得到新的内核码,丢到开发板里。
- 未完待续,遇到一些问题始终无法启动nfs文件系统 有看出问题的小伙伴帮忙指导一下