Build Images
Yocto is using the bitbake
tool to generate complete Linux images/distributions, that is, all needed to boot and run a Linux system. This is typically boot loader(s), Linux kernel, and root file system with selected utilities and applications.
Available Images
The recipes that have been downloaded contain many different images. The table below describe only a few of the images that are available.
Image name | Description |
---|---|
ea-image-base | Only available on branch ea-4.14.78 and later. Based on core-image-base and added packages for peripheral testing and verification. This is Embedded Artists default image and the one included in the pre-build packages on imx.embeddedartists.com. |
core-image-minimal | A minimal image allowing a device to boot |
core-image-base | A console only image that fully supports the target device |
fsl-image-mfgtool-initramfs | Build U-Boot, kernel and file system that can be used by NXP's Manufacturing tool. |
meta-toolchain | Builds an installable toolchain (cross-complier) |
Usually, the name of the file that defines an image contains the string image
. You can search for such files using the find command. Please note that not all images follow this naming convention. The toolchain images are images that doesn't contain image
in the name.
cd ~/ea-bsp/sources
find -name *image*.bb
An alternative way to find images is to use the bitbake-layers
command.
bitbake-layers show-recipes | grep image
Machine Configurations
A machine configuration must be specified before a build can be started.
The table below contains the machine configurations available for Embedded Artists boards. It is also possible to find the configuration files in the directory ~/ea-bsp/sources/meta-ea/conf/machine
.
Machine | Description | Supported Release |
---|---|---|
imx6sxea-com | Machine configuration for Embedded Artists iMX6 SoloX COM Board / Kit | up to ea-5.15.32 |
imx6qea-com | Machine configuration for Embedded Artists iMX6 Quad COM Board / Kit | up to ea-5.15.32 |
imx6dlea-com | Machine configuration for Embedded Artists iMX6 Quad DualLite Board / Kit | up to ea-5.15.32 |
imx6ulea-com | Machine configuration for Embedded Artists iMX6 Quad UltraLite Board / Kit | up to ea-5.15.32 |
imx7dea-ucom | Machine configuration for Embedded Artists iMX7 Dual uCOM Board / Kit | up to ea-5.15.32 |
imx7dea-com | Machine configuration for Embedded Artists iMX7 Dual COM Board / Kit | up to ea-5.15.32 |
imx7ulpea-ucom | Machine configuration for Embedded Artists iMX7ULP uCOM Board / Kit | up to ea-5.10.35 |
imx8mqea-com | Machine configuration for Embedded Artists iMX8M Quad COM Board / Kit | up to ea-5.15.32 |
imx8mmea-ucom | Machine configuration for Embedded Artists iMX8M Mini uCOM Board / Kit | latest |
imx8mnea-ucom | Machine configuration for Embedded Artists iMX8M Nano uCOM Board / Kit | latest |
imx93ea-ucom | Machine configuration for Embedded Artists iMX93 uCOM Board / Kit | latest |
Initialize Build
Before starting the build, it must be initialized. In this step the build directory and local configuration files are created.
A distribution must be selected when initializing the build, see the table in section Distro Configurations below for available distributions.
In the example below the machine imx6sxea-com
, the build directory build_dir
and the fsl-imx-fb
distribution is selected.
DISTRO=fsl-imx-fb MACHINE=imx6sxea-com source ea-setup-release.sh -b build_dir
Distro Configurations
When initializing a build a distribution is specified. Several different are supported as listed in the table below.
DISTRO | Description |
---|---|
fsl-imx-fb | Linux Frame buffer – no X11 or Wayland. This is the distribution used for iMX6 and iMX7 official builds on imx.embeddedartists.com. NOTE: Not supported by iMX8 and iMX93. |
fsl-imx-x11 | Only X11 (X Window System) graphics. |
fsl-imx-wayland | Wayland Weston graphics. This is the distribution used for iMX8 and iMX93 official builds on imx.embeddedartists.com. |
fsl-imx-xwayland | Wayland graphics and X11. X11 applications using EGL are not supported. |
Starting a Build
Everything has now been setup to start the actual build. The example below shows how the ea-image-base image is being built. Please note that depending on the capabilities of your host computer building an image can take many hours.
bitbake ea-image-base
When the build has finished the images will be available in the directory specified below. Please note that this directory will be different if you are using another build directory or machine configuration.
~/ea-bsp/build_dir/tmp/deploy/images/imx6sxea-com
Go to the section Deploy Images for instructions of how to deploy images to the target hardware.
Restart a Build
If you need to restart a build in a new terminal window or after a restart of the host computer you don't need to run the ea-setup-release.sh
script again. Instead, you run the setup-environment
script. If you don't run the setup-environment
script you won't have access to needed tools and utilities, such as bitbake
.
source setup-environment build_dir
Bitbake Options
This section contains a few examples of how to use bitbake
. This is by no means a complete list of all available bitbake options, but instead a list of examples that you might find useful.
Clean Build for a Specific Image/Recipe
The -c
option executes a specific task for an image or recipe. In the example below a previous build of the U-Boot boot loader is cleaned.
bitbake -c cleansstate u-boot-ea
To build U-Boot after it has been cleaned just specify the image name u-boot-ea.
bitbake u-boot-ea
Kernel Configuration
If you would like to check or change the Linux kernel configuration you can start the Linux configuration tool using the option below.
bitbake -c menuconfig linux-ea
Show Yocto Layer Append Dependencies
One nice feature with Yocto is the ability to extend an already existing recipe. This is done by so called .bbappend
files.
When creating your own append files it can be useful to get a list of "appends" that are considered to be active for you build.
bitbake-layers show-appends