How to Build Yocto

The Yocto Project offers open-source tools that enable developers to customize Linux-based systems across various architectures. By following this procedure, you will be able to build a Yocto image specifically for the LEC-iMX95.

1. Set up a build host environment

1.1 Recommended Hardware for the host

  • Intel Core-i7 Processor (>= 4 cores)
  • at least 8GB Memory
  • at least 500GB Disk space
  • Ubuntu 22.04 LTS 64bit or later version for Yocto Project Build
  • High speed network connectivity

1.2 Required Essential Packages to Install on the Host System

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm zstd liblz4-tool curl git python-is-python3

Please avoid using the root account to build Yocto, as it may lead to unpredictable errors.

1.3 Set up the GitHub account on the host

Before starting the build process, verify that Git is correctly set up using the commands below.

$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list

1.4 “Google repo” packages required to be installed in your host

$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=${PATH}:~/bin
$ export LC_ALL="en_US.UTF-8"

2. Fetch the source from Git

2.1 Create a working directory

Create a working directory named ‘imx95-yocto-bsp’.

$ mkdir imx95-yocto-bsp
$ cd imx95-yocto-bsp

2.2 Download the required meta-layers.

It is recommended to use the latest branch and manifest file for building the Yocto image. You can find the available branches and manifest files [Link to be updated].

Scarthgap branch

$ repo init -u https://github.com/ADLINK/adlink-manifest -b lec-imx-yocto-scarthgap -m adlink-lec-imx95-yocto-scarthgap_1v0.xml
$ repo sync
$ MACHINE=lec-imx95 DISTRO=fsl-imx-xwayland source adlink-imx-setup-release.sh -b <build_dir>

2.3 Build the image

To build without Qt 6 and machine learning, use imx-image-multimedia

$ bitbake imx-image-multimedia

To build with Qt 6 and machine learning, use imx-image-full

$ bitbake imx-image-full

Sometimes the build may fail due to the traffic/server try again after sometime

Image is generated as imx-image-full-lec-imx95-*.wic in <build_dir>/tmp/deploy/image/lec-imx95/.