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 | Based on core-image-weston. Adds packages for the DX-M1 AI accelerator and packages for peripheral testing and verification. This is Embedded Artists default image and the one included in the pre-build packages on sw.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 |
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-rz/conf/machine.
| Machine | Description | Supported Release |
|---|---|---|
rzg3e-ea-som | Machine configuration for Embedded Artists RZ/G3E DX-M1 SOM 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 can be selected when initializing the build, see the table in section Distro Configurations below for available distributions.
In the example below the machine rzg3e-ea-som, the build directory build_dir and the rz-vlp distribution is selected.
DISTRO=rz-vlp MACHINE=rzg3e-ea-som source ea-setup-release.sh -b build_dir
As the default distribution is rz-vlp, the command could be shortened to:
MACHINE=rzg3e-ea-som 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 |
|---|---|
rz-bsp | Based on Poky and has only minimum settings. |
rz-vlp | Builds on rz-bsp and adds useful tools for verification. This is the distribution used for the RZ/G3E official builds on sw.embeddedartists.com. |
Remove Dependancy on Optional Proprietary Packages
If you have selected to NOT use the proprietary packages (described in Add Proprietary Packages), open the conf/bblayers.conf file and remove these two lines:
BBLAYERS += "${TOPDIR}/../sources/meta-rz-features/meta-rz-codecs "
BBLAYERS += "${TOPDIR}/../sources/meta-rz-features/meta-rz-graphics "
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/rzg3e-ea-som
Go to the section Deploy Images (uSD) or or Deploy Images (eMMC) 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 have to run the ea-setup-release.sh script again. If you don't run the script you won't have access to needed tools and utilities, such as bitbake.
source ea-setup-release.sh -b 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