01. Build CompuLab Images

vraevsky edited this page Jul 29, 2018 · 32 revisions

Introduction

meta-compulab-imx8 is a set of Yocto Build Environment recipes and configuration files that allows to create CompuLab Yocto Images for CL-SOM-iMX8

  • Supported Yocto NXP Releases: imx-linux-morty
  • Supported CompuLab Machines: cl-som-imx8

NXP Resources

This document is a brief instruction based on the official NXP documentation: L4.9.51_8MQ_GA_LINUX_DOCS

:warning: Please note that NXP login is required in order to access the link above

Prepare Build Machine

Use one of the supported Linux distributions:

  • Ubuntu 14.10
  • Ubuntu 15.04
  • Ubuntu 15.10
  • Ubuntu 16.04 (LTS)
  • Fedora release 22
  • Fedora release 23
  • CentOS release 7.x
  • Debian GNU/Linux 8.x (Jessie)
  • Debian GNU/Linux 9.x (Stretch)
  • openSUSE 13.2
  • openSUSE 42.1

Install essential host packages on your build host.

The following command installs the host packages based on an Ubuntu distribution:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
     xz-utils debianutils iputils-ping libsdl1.2-dev xterm curl

Refer to Yocto Project Docs for details.

Prepare BSP Environment

Install Google repo command:

mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=${PATH}:~/bin

Download the NXP BSP source:

mkdir fsl-release-bsp
cd fsl-release-bsp
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-morty -m imx-4.9.51-8mq_ga.xml
repo sync

Clone meta-compulab and meta-compulab-imx8 layers:

git clone -b devel https://github.com/compulab-yokneam/meta-compulab sources/meta-compulab
git clone -b devel_ga https://github.com/compulab-yokneam/meta-compulab-imx8 sources/meta-compulab-imx8

Build Procedure

Set the required machine: cl-som-imx8

export MACHINE=cl-som-imx8

Select a required distribution

Distribution Command to issue Available Images
fb export DISTRO=fsl-imx-fb fsl-image-validation-imx, fsl-image-qt5-validation-imx
x11 export DISTRO=fsl-imx-x11 fsl-image-validation-imx, fsl-image-qt5-validation-imx, compulab-image-xfce
xwayland export DISTRO=fsl-imx-xwayland fsl-image-validation-imx, fsl-image-qt5-validation-imx
wayland export DISTRO=fsl-imx-wayland fsl-image-validation-imx, fsl-image-qt5-validation-imx

Select a desired image

Image Command to issue Required distribution
fsl-image-validation-imx export IMAGE=fsl-image-validation-imx fb, x11, xwayland, wayland
fsl-image-qt5-validation-imx export IMAGE=fsl-image-qt5-validation-imx fb, x11, xwayland, wayland
compulab-image-xfce export IMAGE=compulab-image-xfce x11

Create Build Environment

This script issues all required NXP & CompuLab setup files

source sources/meta-compulab-imx8/bb-tools/setup-imx8-env -b build-${MACHINE}-${DISTRO}

Build Instruction

Build Yocto image

bitbake ${IMAGE}

Build kernel only

bitbake linux-imx

Build U-Boot only

bitbake imx-boot

How to build U-Boot and Kernel in standalone environment

Generate an SDK from the Yocto Project build environment

cd ${BUILDDIR}
DISTRO=fsl-imx-fb MACHINE=cl-som-imx8 bitbake core-image-minimal -c populate_sdk

Kernel/U-Boot Source Code

Set a target

Kernel U-Boot
export TARGET=linux-imx export TARGET=u-boot-imx
export DEFCONFIG=cl-som-imx8_defconfig export DEFCONFIG=cl-som-imx8_defconfig

Retrieve the target information

bitbake -c devshell ${TARGET}
mkdir -p ${BUILDDIR}/../ooye/${TARGET}
${BUILDDIR}/../sources/meta-compulab-imx8/bb-tools/getenv > ${BUILDDIR}/../ooye/${TARGET}/.rc
exit

Clone the target source code & patch it

cd ${BUILDDIR}/../ooye/${TARGET}
source ${BUILDDIR}/../ooye/${TARGET}/.rc
git clone ${ORIGIN} src
git -C src checkout -b development ${HEAD}
git -C src am ${PATCHES}/*.patch

Building the target

  • For i.MX 8 builds on the host machine, set the environment with the following command before building.
source /opt/fsl-imx-fb/4.9.51-mx8-ga/environment-setup-aarch64-poky-linux
  • Issue build for the target this way:
make -C src ${DEFCONFIG}
make -C src -j8

Proceed to How To Create a Bootable SD card

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.