为了方便调试,需要让开发板挂载ubuntu虚拟机的NFS文件夹,以下为配置步骤
ubuntu系统
sudo apt-get install nfs-kernel-server
sudo apt-get install nfs-common
修改配置文件
sudo vi /etc/exports
/home/cheng/nfsroot *(rw,sync,no_root_squash,no_subtree_check)
重启nfs服务
sudo service nfs-kernel-server restart
显示nfs路径
showmount -e
本地挂载
sudo mount -t nfs -o nolock localhost:/home/cheng/nfsroot /mnt
或直接输入本机IP
sudo mount -t nfs -o nolock 192.168.10.231:/home/cheng/nfsroot /mnt
开发板开启网络,获取ip,正常ping通服务器
mount -t nfs -o nolock 192.168.10.231:/home/cheng/nfsroot /mnt/nfs
若提示没有此设备,说明内核未安装NFS,需要重新编译内核
开发板文件配置
/etc/init.d # vi ifconfig-eth0
if grep -q nfs /proc/mounts ; then
NFS内核配置
进入内核目录
cd iTop4412_Kernel_3.0/
清除编译
make clean
拷贝全能版配置,已配置可跳过
cp config_for_linux_scp_supper .config
配置内核
make menuconfig
[*] Networking support —>
Networking options —>
[*] IP: kernel level autoconfiguration
File systems —>
<*> NFS client support
[*] Network File Systems —>
[*] NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
[*] NFS client support for NFS version 4
[*] NFS client support for NFSv4.1 (EXPERIMENTAL)
[*] Root file system on NFS
保存并退出
执行编译
make zImage
找到编译好的内核镜像arch/arm/boot/
根据上一篇文章,使用fastboot进行内核镜像烧录
《关于win10不能识别iTop4412开发板ADB的处理》
重新挂载网络文件夹
mount -t nfs -o nolock 192.168.10.231:/home/cheng/nfsroot /mnt/nfs
无报错,挂载成功。
编写挂载脚本
vi mount_nfs.sh
内容
mount -t nfs -o nolock 192.168.10.231:/home/cheng/nfsroot /mnt/nfs
以上即iTop4412开发板挂载NFS的全部内容
如果文章对您有帮助,欢迎移至上方按钮打赏博主;