DESK-MX6UL-L/Development/Building the Yocto BSP

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2021/07/21

First DESK-MX6UL-L release

2022/03/16

DESK-MX6UL-L 3.0.0 release

2023/05/05

DESK-MX6UL-L 4.0.0 release

2024/07/01

DESK-MX6UL-L 4.1.0 release

2024/10/25

DESK-MX6UL-L 4.2.1 release

2025/12/17

DESK-MX6UL-L 6.x.x release
2025/12/18 Add kas info


Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository Yocto BSP Layer
URL git@git.dave.eu:desk-mx-l/meta-desk-mx.git
stable branch scarthgap
stable tag desk-mx6ul-l-6.0.0
Build targets
Name Description
dave-image-minimal This image include the core image minimal distro

Introduction[edit | edit source]

As known, in addition to a bootloader and the o.s. kernel, an embedded Linux system needs a root file system to operate. The root file system must contain everything needed to support the Linux system (applications, settings, data, etc.). The root file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the /sbin/init, the first user space process and "father" of all the other processes. For more information on the Linux filesystem, please refer to http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.

To generate the supported root file systems, the build of the Yocto BSP has to be run. The output of this process is an image containing the U-Boot binary file, the Linux kernel image, and the selected root file system image. The following sections describe in detail how to execute this operation.

For more general information regarding the Yocto build system, please refer to the dedicated category page.

How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image with KAS[edit | edit source]

200px-Emblem-important.svg.png

The following procedure requires access to the DAVE Embedded Systems' git repositories. Access to such repositories is granted to the development kit's owners only. Please refer to this page for detailed instructions on how to get it.


200px-Emblem-important.svg.png

This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine. For more details on this topic, please refer to the NXP documentation on this BSP, i.e. the i.MX Yocto Project User's Guide, which talks about the host setup for the Yocto build system.

Initialize the build environment[edit | edit source]

200px-Emblem-important.svg.png

DESK-MX6UL-L-6.x.x Yocto build system uses the kas container feature to ensure reproducible Yocto builds across different development hosts

Before running the build, the KAS environment must be initialized properly.

dvdk@vagrant:~/yocto$ mkdir desk-mx6ul-l
dvdk@vagrant:~/yocto$ cd desk-mx6ul-l/
dvdk@vagrant:~/yocto/desk-mx6ul-l$ virtualenv -p /usr/bin/python3 venv
created virtual environment CPython3.8.10.final.0-64 in 30634ms
  creator CPython3Posix(dest=/home/dvdk/yocto/desk-mx6ul-l/venv, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/dvdk/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
dvdk@vagrant:~/yocto/desk-mx6ul-l$ source venv/bin/activate
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l$ pip3 install kas==4.7
Processing /home/dvdk/.cache/pip/wheels/38/a9/8c/311243e3d15e03994982f62fc92845e0840204e8e726a4760b/kas-4.7-py3-none-any.whl
Collecting GitPython<4,>=3.1.0
  Using cached gitpython-3.1.45-py3-none-any.whl (208 kB)
Collecting PyYAML<7,>=3.0
  Using cached PyYAML-6.0.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (806 kB)
Collecting kconfiglib<15,>=14.1.0
  Using cached kconfiglib-14.1.0-py2.py3-none-any.whl (145 kB)
Collecting distro<2,>=1.0.0
  Using cached distro-1.9.0-py3-none-any.whl (20 kB)
Collecting jsonschema<5,>=2.5.0
  Using cached jsonschema-4.23.0-py3-none-any.whl (88 kB)
Collecting typing-extensions>=3.10.0.2; python_version < "3.10"
  Using cached typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Collecting gitdb<5,>=4.0.1
  Using cached gitdb-4.0.12-py3-none-any.whl (62 kB)
Collecting jsonschema-specifications>=2023.03.6
  Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)
Collecting rpds-py>=0.7.1
  Using cached rpds_py-0.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (360 kB)
Collecting pkgutil-resolve-name>=1.3.10; python_version < "3.9"
  Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
Collecting referencing>=0.28.4
  Using cached referencing-0.35.1-py3-none-any.whl (26 kB)
Collecting importlib-resources>=1.4.0; python_version < "3.9"
  Using cached importlib_resources-6.4.5-py3-none-any.whl (36 kB)
Collecting attrs>=22.2.0
  Using cached attrs-25.3.0-py3-none-any.whl (63 kB)
Collecting smmap<6,>=3.0.1
  Using cached smmap-5.0.2-py3-none-any.whl (24 kB)
Collecting zipp>=3.1.0; python_version < "3.10"
  Using cached zipp-3.20.2-py3-none-any.whl (9.2 kB)
Installing collected packages: typing-extensions, smmap, gitdb, GitPython, PyYAML, kconfiglib, distro, rpds-py, attrs, referencing, zipp, importlib-resources, jsonschema-specifications, pkgutil-resolve-name, jsonschema, kas
Successfully installed GitPython-3.1.45 PyYAML-6.0.3 attrs-25.3.0 distro-1.9.0 gitdb-4.0.12 importlib-resources-6.4.5 jsonschema-4.23.0 jsonschema-specifications-2023.12.1 kas-4.7 kconfiglib-14.1.0 pkgutil-resolve-name-1.3.10 referencing-0.35.1 rpds-py-0.20.1 smmap-5.0.2 typing-extensions-4.13.2 zipp-3.20.2
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l$ g

then, fetch the meta-desk-mx repositories with the proper branch:

(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l$ git clone git@git.dave.eu:desk-mx-l/meta-desk-mx.git -b desk-mx6ul-l-6.0.0

Running the build[edit | edit source]

Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB of disk space is required for the build. The process may be slowed down significantly since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, to consider the following options:

  • Migrating the build system to a physical machine
  • Assuming that the host system has the required resources, extending the hardware capabilities of the default MVM (e.g. adding more cores and disk space).

Once the initialization phase, developers can choose the Yocto image to build with KAS

  • for example build of dave-image-minimal image with DESK-MX6UL-L AXEL ULite machine and fsl-imx-fb distro, enter the repo directory and
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l$ cd meta-desk-mx/
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-axelulite.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml
  • for example build of dave-image-minimal image with DESK-MX6UL-L SBC RIALTO machine and fsl-imx-fb distro, enter the repo directory and
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l$ cd meta-desk-mx/
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-rialto.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml
  • in case of error due to downloads path, please use the command below into the repository directory
export DL_DIR=./downloads

Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in build/tmp/deploy/images/<machine_name>.

Generating the SDKs[edit | edit source]

(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ KAS_TASK="populate_sdk" kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-axelulite.yml:ci/fsl-imx-fb.yml:ci/core-image-minimal.yml

Generating the Toolchain[edit | edit source]

The toolchain can be created by the following command:

(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ KAS_TARGET="meta-toolchain" kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-axelulite.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ KAS_TARGET="meta-toolchain" kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-rialto.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml

Building additional packages[edit | edit source]

To build additional packages, for example memtester the user need to perform the following command

(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ KAS_TARGET="memtester" kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-axelulite.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml
(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx/meta-desk-mx$ KAS_TARGET="memtester" kas-container --repo-rw --ssh-dir ~/.ssh build ci/desk-mx6ul-rialto.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml

Building with bitbake[edit | edit source]

To use the traditional bitbake instead of kas, it is possible to invoke a kas shell where using it:

(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx$  kas-container --repo-rw --ssh-dir ~/.ssh shell ci/desk-mx6ul-axelulite.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml
2025-12-18 10:32:55 - INFO     - kas 4.7 started
2025-12-18 10:32:55 - INFO     - Using /repo as root for repository meta-desk-mx
2025-12-18 10:32:55 - INFO     - Repository meta-dave already contains 988f0475300d2f5ff4cea89df5eebfb16e8ad28d as commit
2025-12-18 10:32:55 - INFO     - Repository meta-flutter already contains 545eda504de8d9e7b7d2911898e891cb016b6693 as commit
2025-12-18 10:32:55 - INFO     - Repository poky already contains 200d12b6a58ad961d60a7774ca0f7a9d29498724 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-openembedded already contains 72018ca1b1a471226917e8246e8bbf9a374ccf97 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-clang already contains 2b7433611d80f6d0ee1b04156fa91fc73d3c2665 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-freescale already contains 0627128b341cfb2bef7a0832ce8cac0ce1127f13 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-freescale-3rdparty already contains 6c063450d464eb2f380443c7d9af1b94ce9b9d75 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-freescale-distro already contains b9d6a5d9931922558046d230c1f5f4ef6ee72345 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-arm already contains 950a4afce46a359def2958bd9ae33fc08ff9bb0d as commit
2025-12-18 10:32:55 - INFO     - Repository meta-qt6 already contains 586a6cb5aec755803a3be3cec359baafe89d6432 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-security already contains 459d837338ca230254baa2994f870bf6eb9d0139 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-timesys already contains 4dc3f4bdfde4a86904b6e1a3d58df4696e7a63fa as commit
2025-12-18 10:32:55 - INFO     - Repository meta-virtualization already contains 6f3c1d8f90947408a6587be222fec575a1ca5195 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-imx already contains e83d4402acde050d2b2761995761c81c797b5b03 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-nxp-connectivity already contains f58365ec75a5768ff3e8e8bcd64f237738c93160 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-nxp-demo-experience already contains e8e646e22b1f926aac83bb7ad522efa9cd8ccc45 as commit
2025-12-18 10:32:55 - INFO     - Repository meta-dave checked out to 988f0475300d2f5ff4cea89df5eebfb16e8ad28d
2025-12-18 10:32:55 - INFO     - Repository meta-flutter checked out to 545eda504de8d9e7b7d2911898e891cb016b6693
2025-12-18 10:32:55 - INFO     - Repository poky checked out to 200d12b6a58ad961d60a7774ca0f7a9d29498724
2025-12-18 10:32:55 - INFO     - Repository meta-openembedded checked out to 72018ca1b1a471226917e8246e8bbf9a374ccf97
2025-12-18 10:32:55 - INFO     - Repository meta-clang checked out to 2b7433611d80f6d0ee1b04156fa91fc73d3c2665
2025-12-18 10:32:55 - INFO     - Repository meta-freescale checked out to 0627128b341cfb2bef7a0832ce8cac0ce1127f13
2025-12-18 10:32:55 - INFO     - Repository meta-freescale-3rdparty checked out to 6c063450d464eb2f380443c7d9af1b94ce9b9d75
2025-12-18 10:32:55 - INFO     - Repository meta-freescale-distro checked out to b9d6a5d9931922558046d230c1f5f4ef6ee72345
2025-12-18 10:32:55 - INFO     - Repository meta-arm checked out to 950a4afce46a359def2958bd9ae33fc08ff9bb0d
2025-12-18 10:32:55 - INFO     - Repository meta-qt6 checked out to 586a6cb5aec755803a3be3cec359baafe89d6432
2025-12-18 10:32:55 - INFO     - Repository meta-security checked out to 459d837338ca230254baa2994f870bf6eb9d0139
2025-12-18 10:32:55 - INFO     - Repository meta-timesys checked out to 4dc3f4bdfde4a86904b6e1a3d58df4696e7a63fa
2025-12-18 10:32:55 - INFO     - Repository meta-virtualization checked out to 6f3c1d8f90947408a6587be222fec575a1ca5195
2025-12-18 10:32:56 - INFO     - Repository meta-imx checked out to e83d4402acde050d2b2761995761c81c797b5b03
2025-12-18 10:32:56 - INFO     - Repository meta-nxp-connectivity checked out to f58365ec75a5768ff3e8e8bcd64f237738c93160
2025-12-18 10:32:56 - INFO     - Repository meta-nxp-demo-experience checked out to e8e646e22b1f926aac83bb7ad522efa9cd8ccc45
2025-12-18 10:32:56 - INFO     - To start the default build, run: bitbake -c build dave-image-minimal
builder@47e71e32a40b:/build$ 

and then it is possible to run a typical bitbake command, like:

builder@47e71e32a40b:/build$ export DL_DIR=./downloads
builder@47e71e32a40b:/build$ bitbake memtester
Loading cache: 100% |#########################################################################################################################################################| Time: 0:00:04
Loaded 5988 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:01
Parsing of 3905 .bb files complete (3901 cached, 4 parsed). 5992 targets, 800 skipped, 3 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.8.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "debian-12"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "desk-mx6ul-axelulite"
DISTRO               = "fsl-imx-fb"
DISTRO_VERSION       = "6.6-scarthgap"
TUNE_FEATURES        = "arm vfp cortexa7 neon thumb callconvention-hard"
TARGET_FPU           = "hard"
...
...

Moreover, with kas checkout it is possible to checking out the configuration and - for example - save the bblayers.conf and local.conf files:

(venv) dvdk@vagrant:~/yocto/desk-mx6ul-l/meta-desk-mx$ kas-container --repo-rw --ssh-dir ~/.ssh checkout ci/desk-mx6ul-axelulite.yml:ci/fsl-imx-fb.yml:ci/dave-image-minimal.yml