i.MX8 - iMX8MEVK - Yocto - Building Yocto
Yocto has several versions but only Morty and Rocko support iMX8 boards.
Dependencies
Before running Yocto, install its dependencies with the following command.
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \ chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping \ libsdl1.2-dev xterm autoconf libtool libglib2.0-dev python-git sed cvs subversion coreutils \ texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev \ libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \ libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev gawk wget git-core diffstat unzip \ texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping
Setting up Repo tool
Yocto's meta-layers are configured through repo tool, install it as follows.
mkdir ~/bin curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo export PATH=~/bin:$PATH
Getting Source Code
The Yocto's source code is downloaded according to a manifest file that controls Yocto's meta-layers. The repo tool requires a manifest file as an argument to download files, set Yocto as follows.
mkdir imx-yocto-bsp cd imx-yocto-bsp BRANCH=imx-linux-morty MANIFEST=imx-4.9.51-8mq_ga.xml repo init -u https://github.com/nxp-imx/imx-manifest -b $BRANCH -m $MANIFEST repo sync
Set your desired yocto version using the following variables.
Yocto version | Variable | Value |
---|---|---|
Morty | BRANCH | imx-linux-morty |
MANIFEST | imx-4.9.51-8mq_ga.xml | |
Rocko | BRANCH | imx-linux-rocko |
MANIFEST | imx-4.9.88-2.1.0-8mm_alpha.xml |
Configuration
Set host's environment variables and create default configuration files by running fsl-setup-release script. Currently (November 2018) only Wayland distro is supported.
BUILD_DIR=build DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b $BUILD_DIR
In the first run, DISTRO and MACHINE variables are stored in your default configuration files. In the second (or more) run with the same BUILD_DIR, the environment variables will be loaded from your previous configuration files. In other words, running the previous instructions again with other DISTRO and MACHINE will not change your DISTRO and MACHINE from your default configuration files. If you need to change environment variables from a previous run, you must modify your default files at BUILD_DIR/conf.
Building
Keep in mind that the building can be configured with arguments, check the following tabla for more details.
Option | Description |
---|---|
-c <task> | Execute specific tasks for the image or recipe. Some examples: fetch, compile, clean, cleansstate, package. |
-f | Force execution. |
-v | Verbose mode. |
-DDD | Enable debug information. |
-s | Show recipe version. |
-g <recipe> | Show dependency tree for the recipe. |
-c listtasks <image_or_recipe> | Show the tasks associated with a recipe or image. |
-k | keep running if an error appears. |
--help | Detailed help information. |
In order to build your image, run the next command:
IMAGE=core-image-minimal OPTION=-k bitbake $IMAGE $OPTION
Other available images:
- fsl-image-multimedia
- fsl-image-validation-imx
- fsl-image-qt5-validation-imx
- fsl-image-multimedia-full
The images will be stored under the directory: <BUILD_DIR>/tmp/deploy/images/imx8mevk
Please refer to Installing an Image section for more information about how to use your image.