i.MX6 Yocto QT5环境搭建流程

目录:

i.MX6 Yocto 环境搭建流程

Freescale Yocto Project
• Linux distributed build system
• Replacement for LTIB
• Higher integration with community
• Flexible release targets

安装环境:
    Vmware Workstation 14 Pro
    Ubuntu 16.04 LTS(注:磁盘空间不少于120G)

1. Host Setup

1.1 Host packages安装软件包

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc

Ubuntu 12.04 安装uboot-mkimage:

$ sudo apt-get install uboot-mkimage

Ubuntu 14.04 安装u-boot-tools:

$ sudo apt-get install u-boot-tools

1.2 设置repo程序

$ mkdir ~/bin
// 若已存在则无需创建
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
// 需要访问谷歌,所以需要翻墙,不能翻墙则执行这一条命令,如下:
$ curl http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo > /opt/yocto/bin/repo
$ chmod a+x ~/bin/repo

将以下指令添加到.bashrc中确保~/bin包含在PATH

export PATH=~/bin:$PATH

2. Yocto Project Setup

2.1 设置git

$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list

2.2 获取BSP

$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-rocko -m imx-4.9.88-2.0.0_ga.xml
// 需访问谷歌,改为执行这一条命令,如下:
$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable
// 若在repo初始化过程中发生错误,则删除.repo目录,重新执行repo初始化命令即可。
$ repo sync

3. Image Build

3.1 设置脚本环境

命令格式:

$ DISTRO=<distro name> MACHINE=<machine name> source fsl-setup-release.sh -b <build dir>

DISTRO有四种:
• fsl-imx-x11
• fsl-imx-wayland
• fsl-imx-xwayland
• fsl-imx-fb

MACHINE有以下:
• imx6qpsabreauto
• imx6qpsabresd
• imx6ulevk
• imx6ull14x14evk
• imx6ull9x9evk
• imx6dlsabreauto
• imx6dlsabresd
• imx6qsabreauto
• imx6qsabresd
• imx6slevk
• imx6solosabreauto
• imx6solosabresd
• imx6sxsabresd
• imx6sxsabreauto
• imx6sllevk
• imx7dsabresd
• imx7ulpevk
• imx8mqevk

这里采用以下命令:

$ DISTRO=fsl-imx-fb MACHINE=imx6qsabresd source fsl-setup-release.sh -b build

3.2 编译镜像文件

$ bitbake fsl-image-qt5

编译过程很长,一天左右。若中途出错可以ctrl+c中断后程序执行$ bitbake fsl-image-qt5命令,
若编译过程中关掉了终端,那么重新打开终端进入fsl-release-bsp目录后只需要执行以下命令就可以重新进入编译环境:

$ source setup-environment build

3.3 编译qt5的交叉编译工具链

$ bitbake meta-toolchain-qt5

编译完成后会在/opt/yocto/fsl-release-bsp/build/tmp/deploy/sdk目录下生成文件fsl-imx-fb-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.0.0.sh
执行如下命令安装qt5的交叉编译工具链:

$ cd /opt/yocto/fsl-release-bsp/build/tmp/deploy/sdk
$ ./fsl-imx-fb-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.0.0.sh

3.4 编译gcc交叉编译工具链

$ bitbake meta-toolchain

编译完成后会在/opt/yocto/fsl-release-bsp/build/tmp/deploy/sdk目录下生成.sh 文件
同样执行.sh文件安装gcc的交叉编译工具链。

参考官方文档:i.MX_Yocto_Project_User’s_Guide_Linux.pdf

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值