yocto

1、Ubuntu18.04.4

2、$ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev

$ sudo apt-get install  python-pysqlite2

$ sudo apt-get install  curl

3、$ mkdir ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

4、vi ~/.bashrc
export PATH=~/bin:$PATH

5、git
添加 git config
$ git config --global user.name “Your Name”
$ git config --global user.email “Your Email”
查看 git config -list

1、NXP
https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX?tab=In-Depth_Tab

2、https://source.codeaurora.org/external/imx/imx-manifest/tree/README?h=imx-linux-warrior

3、L4.19.35

4、下载
$ cd ~
$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-warrior -m imx-4.19.35-1.1.0.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo

repo init -u https://source.codeaurora.org/external/imx/imx-manifest
-b imx-linux-zeus -m imx-5.4.47-2.2.0.xml

repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.47-2.2.0.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo

repo sync

5、执行编译
$ DISTRO=fsl-imx-xwayland MACHINE=imx8mqevk source fsl-setup-release.sh -b build-xwayland

Qt
$bitbake imx-image-full

清理重新编译
//bitbake imx-image-full -c cleanall

$bitbake -c cleansstate imx-image-full

6、编译Qt5的交叉编译工具链
$ bitbake meta-toolchain-qt5 // 生成带有qt5的交叉编译工具链

7、编译时可添加的参数

-c fetch		先下载后编译

-c deploy		将编译生成的镜像,部署到rootfs

8、U-Boot
首次编译出的uboot,是SD卡启动的

U-Boot配置文件,在local.conf中设置UBOOT_CONFIG

$ MACHINE=imx8mqevk bitbake -c deploy u-boot-imx


echo "UBOOT_CONFIG = \"emmc\"" >> conf/local.conf

9、ERROR: Task (/home/touchvision/imx-yocto-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-graphics/opencv/opencv_4.0.1.imx.bb:do_compile) failed with exit code ‘1’

10、 $ bitbake -c cleansstate imx-image-full
$ bitbake -c clean imx-image-full

$ bitbake imx-image-full --runall=fetch
$ bitbake imx-image-full

11、重新开始
$ source setup-environment build-xwayland
$ bitbake imx-image-full

12、kernel源代码目录 链接文件 /tmp/work/imx8qmmek-poky-linux/linux-imx/4.14.98-r0/git

/tmp/work-shared/imx8mqevk/kernel-source

13、u-boot源代码目录

/tmp/work/imx8qmmek-poky-linux/u-boot-imx/2018.03-r0

14、单独编译kernel u-boot

注意:
我们修改了kernel或者u-boot的源代码,直接运行bitbake fsl-image-qt5是不会编译我们修改的源代码的。所以就需要我们单独编译源代码。


例子:
$ cd ~/imx8qm/imx-4.14.98-2.0.0_ga //进入工程目录
$ source setup-environment build-xwayland-imx8qmmek-xen //加载编译环境

配置menuconfig
$ bitbake -c menuconfig -v linux-imx

kernel:
$ bitbake -c compile -f -v linux-imx
$ bitbake linux-imx -c compile_kernelmodules -f -v
$ bitbake -c deploy -f -v linux-imx

u-boot:
$bitbake -c compile -f -v u-boot-imx
$bitbake -c deploy -f -v u-boot-imx

bitbake -c cleanstate u-boot

tmp/deploy/images/imx8mqevk/Image

上一篇:完美的失败方案让 repo init 安卓源码仓库恢复到最初状态


下一篇:SaltStack之return与job管理