Building Images

Setup Build Directory

Starting with Yocto Wrynose, the build directory is set up with the bitbake-setup tool instead of karo-setup-release.sh. Run the following command in the root directory of the cloned BSP repository (see BSP Setup):

bitbake-setup init

The command interactively asks you to choose the configuration options:

  • Configuration template: default.conf.json (the Ka-Ro NXP BSP configuration shipped in the configurations directory of the repository).

  • Machine: the target module to build for.

  • Distro: the target distribution.

  • Baseboard: the baseboard the module is mounted on (or none).

  • Configuration: default or default-with-eula. Choose default-with-eula to accept the Freescale/NXP EULA, which is required to build images containing NXP EULA-licensed packages (e.g. hardware codecs).

There are different configurations you can choose from.

  • Ka-Ro DISTRO configurations

DISTRO=

Description

karo-minimal

Ka-Ro Linux Distro with minimal read-only rootfs

karo-wayland

Ka-Ro Linux Distro with wayland backend

karo-xwayland

Ka-Ro Linux Distro with wayland backend and X11 compatibility layer

  • Possible MACHINE configurations:

MACHINE=

qs95-9610

  • Possible baseboards (selected via the baseboard option, sets KARO_BASEBOARD):

KARO_BASEBOARD=

Description

(empty)

No baseboard (module-only configuration)

qsbase95

QSBase95 baseboard

bitbake-setup then checks out all layers defined in the configuration template into the layers directory of the new setup and creates a ready-to-use build directory. The resulting directory layout below the repository root is:

bitbake-builds/
├── settings.conf
├── site.conf
└── <distro>-<machine>-wrynose/     # e.g. karo-minimal-qs95-9610-wrynose
    ├── build/                       # the BitBake build directory (conf/, tmp/, ...)
    ├── config/                      # the bitbake-setup configuration instance
    └── layers/                      # the checked-out layers (meta-karo-nxp, ...)

Note

The setup directory name is just an example and depends on the choices made during bitbake-setup init.

To enter the build environment of a setup, source the init-build-env script in its build directory:

. bitbake-builds/<distro>-<machine>-wrynose/build/init-build-env
  • Specific Example:

. bitbake-builds/karo-minimal-qs95-9610-wrynose/build/init-build-env
  • Managing setups:

bitbake-setup provides additional commands to manage your setups, e.g. bitbake-setup list to list the available configuration templates and existing setups, bitbake-setup status to check if a setup is in sync with its configuration template, and bitbake-setup update to bring a setup up to date with upstream changes. See the bitbake-setup documentation for details.

Configuration

To enable different features for your build you can modify the conf/local.conf file inside the build directory of your setup (bitbake-builds/<setup>/build/conf/local.conf).

Baseboard (optional)

The baseboard is selected during bitbake-setup init via the baseboard option, which sets KARO_BASEBOARD through an OE configuration fragment. To change it afterwards, set KARO_BASEBOARD to the shortcut of the respective baseboard in your conf/local.conf:

KARO_BASEBOARD = "qsbase95"

Machine Features

Machine Feature

Description

Default?

emmc

eMMC storage support

Automatically selected via $MACHINE if supported

nand

NAND storage support

Automatically selected via $MACHINE if supported

optee

OP-TEE support

Automatically selected via $MACHINE if supported

pcie

PCIe interface support

Automatically selected via $MACHINE if supported

gpu

Module has access to a GPU

Automatically selected via $MACHINE if supported

lvds

LVDS interface support

Automatically selected via $MACHINE if supported

Note

Not all may be listed, see Yocto layers for more.

To expand the MACHINE_FEATURES variable to your needs, modify your conf/local.conf:

MACHINE_FEATURES:append = " item1 item2 ..."

Distro Features

Distro Feature

Description

Default?

systemd

Changes init-system to systemd, e.g. neccessary when using Debian

No

ipv6

IPV6 support

No

wifi

WiFi support

No

bluetooth

Bluetooth support

No

Note

Not all may be listed, see Yocto layers for more.

To expand the DISTRO_FEATURES variable to your needs, modify your conf/local.conf:

DISTRO_FEATURES:append = " item1 item2 ..."

Build the Image

Build the image with the following command inside the build directory of your setup:

bitbake <image>

Here are the different images that can be built:

Image

Description

DISTRO

Provided by layer

karo-image-minimal

Image with minimal read-only rootfs

karo-minimal

meta-karo-distro

karo-image-weston

Image with basic weston desktop, graphics accelerated

karo-(x)wayland

meta-karo-distro

karo-image-qt6

Image with basic weston desktop and QT6. To use it with QT-Creator see QT Guide

karo-(x)wayland

meta-karo-distro

karo-image-ml

Image including and supporting imx Machine-Learning demos See Machine Learning Guide

karo-(x)wayland

meta-karo-distro

To build the SDK of a certain image run inside the build directory of your setup:

bitbake <image> -c populate_sdk

Tip

The SDK can e.g. be used for VS Code Cross-Compilation.

Image Deployment

After a build is complete, the results reside in the bitbake-builds/<setup>/build/tmp/deploy/images/<machine>/<image> sub-directory. An image is, for the most part, specific to the machine set in the environment setup. Each image build usually creates U-Boot, kernel, and an image based on the machine and distro configuration files.

i.MX

To continue programming your board with these images, simply cd into the above mentioned <image> folder inside the deploy directory and run:

uuu -v

For further information about uuu see UUU - Universal Update Utility.


Tip

See what you can do with Yocto built images on your module at Linux. If you compiled karo-image-qt6 check out QT Guide.