arm-cotex-A9 M6708 文件系统移植记录
本文的主要内容是:记录在移植文件系统时所遇到的问题。
工具
* ubuntu 16.04.2 server i386(开启ssh、samba功能)
* buildroot-2017.02.3 (借助buildroot工具可以快速搭建文件系统)
* Qt-everywhere-opensource-src-5.6.2(此版本为企业长期服务版3年,且该版本不要求使用支持C++11的编译器)
过程
解压buildroot-2017.02.3,并进入该目录。
-
安装软件:
- sudo apt-get install libncurses5-dev(make menuconfig需要的包)
- sudo apt-get install texinfo(makeinfo需要的包)
- sudo apt-get install g++
- 其他的根据提示安装
-
make menuconfig(参考http://www.linuxdiyf.com/linux/22191.html)
- 音频需要安装alsa库,环境变量添加:export ALSA_CONFIG_PATH=/usr/share/alsa/alsa.conf
- 不要用buildroot安装Qt,因为它只能安装界面库,音频库及其他很多库都没有。
- 可以用buildroot安装tslib,环境变量如下(配置按实际情况修改):
- export TSLIB_TSDEVICE=/dev/input/event0
- export TSLIB_TSEVENTTYPE=input
- export TSLIB_CONFFILE=/etc/ts.conf
- export TSLIB_PLUGINDIR=/usr/lib/ts
- export TSLIB_CALIBFILE=/etc/pointercal
- export TSLIB_CONSOLEDEVICE=none
- export TSLIB_FBDEVICE=/dev/fb0
- 其他按实际需要选择安装
-
make
- buildroot的输出目录在buildroot-2017.02.3/output中,文件系统打包在image目录下
-
编译Qt5.6.2
- 解压Qt源码
- 修改qt-everywhere-opensource-src-5.6.2\qtbase\mkspecs\linux-arm-gnueabi-g++\qmake.conf
- 使用buildroot的交叉编译链/home/cat/workspace/buildroot-2017.02.3/output/host/usr/bin/arm-none-linux-gnueabi-gcc
- PATH=”/home/cat/workspace/buildroot-2017.02.3/output/host/bin:/home/cat/workspace/buildroot-2017.02.3/output/host/sbin:/home/cat/workspace/buildroot-2017.02.3/output/host/usr/bin:/home/cat/workspace/buildroot-2017.02.3/output/host/usr/sbin:/home/cat/bin:/home/cat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin” PKG_CONFIG=”/home/cat/workspace/buildroot-2017.02.3/output/host/usr/bin/pkg-config” PKG_CONFIG_LIBDIR=”/home/cat/workspace/buildroot-2017.02.3/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/pkgconfig” PKG_CONFIG_SYSROOT_DIR=”/home/cat/workspace/buildroot-2017.02.3/output/host/usr/arm-buildroot-linux-gnueabi/sysroot” MAKEFLAGS=” –no-print-directory – -j5” ../qt-everywhere-opensource-src-5.6.2/configure -nomake tests -confirm-license -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /home/cat/workspace/tools/armQt5.6.2 -qt-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -nomake examples -nomake tools -no-opengl -alsa -glib -pulseaudio
- PATH=”/home/cat/workspace/buildroot-2017.05.2/output/host/bin:/home/cat/workspace/buildroot-2017.05.2/output/host/sbin:/home/cat/workspace/buildroot-2017.05.2/output/host/usr/bin:/home/cat/workspace/buildroot-2017.05.2/output/host/usr/sbin:/home/cat/workspace/buildroot-2017.05.2/output/host/bin:/home/cat/workspace/buildroot-2017.05.2/output/host/sbin:/home/cat/workspace/buildroot-2017.05.2/output/host/usrbin:/home/cat/workspace/buildroot-2017.05.2/output/host/usr/sbin:/home/cat/bin:/home/cat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/snap/bin”
- PKG_CONFIG=”/home/cat/workspace/buildroot-2017.05.2/output/host/usr/bin/pkg-config”
- PKG_CONFIG_LIBDIR=”/home/cat/workspace/buildroot-2017.05.2/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/pkgconfig”
- PKG_CONFIG_SYSROOT_DIR=”/home/cat/workspace/buildroot-2017.05.2/output/host/usr/arm-buildroot-linux-gnueabi/sysroot”
- ../qt-everywhere-opensource-src-5.9.1/configure -nomake tests -confirm-license -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /home/cat/workspace/tools/armQt5.9.1 -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -nomake examples -nomake tools -no-opengl -alsa -glib -pulseaudio -skip serialbus
- 路径按实际情况修改
- make -j4
- make install
-
将编译好的Qt库(lib文件夹)和插件(plugins文件夹)复制到文件系统中。
- 编译好的Qt的bin目录下需要新增一个qt.conf文件,内容如下:
- [Paths]
- Prefix=..
-
添加Qt环境变量
- export QT_QPA_FB_TSLIB=1
- export QT_QPA_GENERIC_PLUGINS=tslib
- export QT_QPA_PLATFORM=LinuxFb:fb=$TSLIB_FBDEVICE
- export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/plugins
- export QT_QPA_FONTDIR=/usr/lib/fonts
- export QML_IMPORT_PATH=/usr/qml
- export QML2_IMPORT_PATH=/usr/qml