虚拟机:win10上的ubuntu14.04
一.安装交叉编译器
1.解压缩
在EPC_IoT_M6GxC_A6GxC_V1.06.00\05. 源码示例\编译工具下找到gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2拷贝到虚拟机某个路径下,本例放在~/Desktop
tar jxvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2
2.设置环境变量
export PATH=/home/chvda/Desktop/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin:$PATH
3.测试
arm-linux-gnueabihf-gcc
正常的话会反馈:
arm-linux-gnueabihf-gcc: fatal error: no input files
compilation terminated.
如果显示:
error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
安装
sudo apt-get install lib32z1
如果显示:
bash: /home/chvda/Desktop/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc: No such file or directory
需要安装32位兼容库
apt-get install lib32ncurses5
apt-get install lib32z1
(ubuntu16参考Ubuntu16.04安装32位支持库_tasty-CSDN博客_lib32ncurses5 lib32z1)
二.安装NFS服务器
1.安装依赖包
sudo apt-get install nfs-kernel-server
sudo apt-get install nfs-common
2. 服务器等相关软件后,本例中指定桌面/home/chvda/Desktop为用于共享的NFS目录
sudo vi /etc/exports
添加/home/chvda/Desktop *(rw,sync,no_root_squash)到文件最末一行
3.启动NFS服务
sudo /etc/init.d/nfs-kernel-server start
4.挂载到ARM板卡上(本例的PC机IP是192.168.0.7,而ubuntu如下图使用桥接方式后,ubuntu的IP为192.168.0.8)
在ARM板命令行上执行命令mount -t nfs 192.168.0.8:/home/chvda/Desktop /mnt -o nolock
此时可以看到ARM板卡的/mnt下已经同步显示PC虚拟机桌面的文件了。