Building CL-SOM-iMX8 Yocto Linux images

From Compulab Mediawiki
Jump to: navigation, search

Overview

The Yocto Project is an open-source collaboration focused on embedded Linux development.
The purpose of this article is to show how to build Yocto Image with support for the CL-SOM-iMX8 System-on-Module.

Learn more about Yocto

Yocto Environment Setup

Yocto host requirements are listed on the Yocto official site

In order to get NXP Yocto BSP building environment please issue the following commands. More detailed instructions can be found at the NXP readme file

repo init -u git://source.codeaurora.org/external/imx/imx-manifest.git -b imx-linux-sumo -m imx-4.14.98-2.0.0_ga.xml
repo sync

Next step is getting the Compulab BSP meta-layer.

git clone -b master https://github.com/compulab-yokneam/meta-bsp-imx8mq.git sources/meta-bsp-imx8mq
git -C sources/meta-bsp-imx8mq checkout master

The Compulab meta-layer consists of meta-compulab directory, that provides support for CL-SOM-iMX8 and other Compulab i.MX based machines and contains recipes for U-boot and Linux kernel.

Building the Image

Create Build Environment

  • Set the required machine, the required distribution, and the desired image
export MACHINE=cl-som-imx8
export DISTRO=fsl-imx-xwayland
export IMAGE=fsl-image-qt5-validation-imx
  • Issue Compulab Setup Script:
 source sources/meta-bsp-imx8mq/tools/setup-imx8mq-env -b build-${MACHINE}-${DISTRO}

Building the images

The Yocto Project build uses the bitbake command.

  • To build a full Compulab image with GUI use the command below:
bitbake -k ${IMAGE}
  • To build a minimal Linux image use the command below:
bitbake -k core-image-full-cmdline
  • To re-build only the Linux kernel use the command below:
source setup-environment ${IMAGE}
bitbake -c cleansstate linux-imx
bitbake -k linux-imx
  • To re-build only the u-boot bootloader and boot image use the command below:
source setup-environment ${IMAGE}
bitbake -c cleansstate imx-boot u-boot-imx
bitbake -k imx-boot u-boot-imx