C

Building Your Own Embedded Linux Image

Boot to Qt for embedded Linux is built using the tools and resources from the Yocto Project, and is based on Yocto's reference distribution (Poky). You can use the same tools to build custom Boot to Qt images, and have control over which packages are included in the build and how the software stack is configured.

Note About Support Services for Yocto Tools

By default, The Qt Company will only provide customer support for the Yocto recipes on the reference platforms, as delivered with Qt for Device Creation, and setting up the development environment for them. Receiving support for any other configuration requires a separate service agreement between a customer and The Qt Company.

Requirements

You should be familiar with the Yocto tools and the concept of recipes. For more information, see Yocto Project documentation.

To get started, you need the following:

  • Install the Boot to Qt source packages. You can find these by running the MaintenanceTool application located in the Qt for Device Creation installation directory and selecting Package Manager. The Yocto meta layer package contains the additional recipes required to make the image compatible with Boot to Qt.
  • Install the dependencies for the Yocto tools. In Ubuntu, the following packages are required:
    sudo apt-get install gawk curl git-core diffstat unzip p7zip-full texinfo \
    gcc-multilib build-essential chrpath libsdl1.2-dev xterm gperf bison \
    g++-multilib

Setting Up Yocto Build Environment

Run the setup script that initializes the Yocto environment. Using Freescale SABRE SD i.MX6Quad as an example:

cd <BuildDir>
<INSTALL_DIR>/5.9/Boot2Qt/sources/meta-b2qt/b2qt-init-build-env init --device imx6qsabresd

b2qt-init-build-env has the following additional command line options:

  • list-devices: show all supported devices that can be used for a Boot to Qt build
  • mirror: create a local mirror of the yocto repositories. This enables you to use the same repository downloads for multiple build environments, when initializing with init --reference <mirror path>.

For all command line options, see:

<INSTALL_DIR>/5.9/Boot2Qt/sources/meta-b2qt/b2qt-init-build-env help

Note: Support for Kontron SMARC-sAMX6i requires additional Yocto Board Support Package that is downloadable from Kontron Customer Section.

Building the Image and Toolchain

After the Yocto environment is set up, you need to configure the build environment for your target device:

export MACHINE=imx6qsabresd
source ./setup-environment.sh

The following table lists the MACHINE values for our reference platforms:

BoardMACHINE value
Toradex Apalis iMX6apalis-imx6
NVIDIA Jetson TX1jetson-tx1
Emulatoremulator
Raspberry Piraspberrypi
Raspberry Pi 2raspberrypi2
Raspberry Pi 3raspberrypi3
BeagleBone Blackbeaglebone
Boundary Devices i.MX6 Boardsnitrogen6x
Freescale SABRE SD i.MX6Quadimx6qsabresd
Freescale SABRE SD i.MX6Dualimx6dlsabresd
Toradex Colibri iMX6colibri-imx6
Toradex Colibri iMX7colibri-imx7
Toradex Colibri VFcolibri-vf
Kontron SMARC-sAMX6ismarc-samx6i
Intel NUCintel-corei7-64
WaRP7imx7s-warp
NVIDIA DRIVE CXtegra-t18x

Yocto recipes for Boot to Qt for embedded Linux have two main targets to build: The target image, and the external toolchain that can be used with Qt Creator for building Qt applications.

bitbake b2qt-embedded-qt5-image
bitbake meta-toolchain-b2qt-embedded-qt5-sdk

The target rootfs image is located in the <YoctoBuildDir>/tmp/deploy/images/<target>/b2qt-embedded-qt5-image-<target>.img, and the new toolchain is in <YoctoBuildDir>/tmp/deploy/sdk/b2qt-x86_64-meta-toolchain-b2qt-embedded-qt5-sdk-<target>.sh

Configuring Qt Creator

Once the toolchain is built, you can install it by running the generated .sh script. After you have built and installed the toolchain, you must also set up Qt Creator in order to start developing for your device. The following script does this for you.

<TOOLCHAIN_DIR>/configure-qtcreator.sh

This will set up a new kit in Qt Creator, using the toolchain and Qt from the installed toolchain. The new kit is visible under Tools > Options > Build & Run > Kits.

Using Toolchain without Qt Creator

The toolchain can be also used without Qt Creator. qmake, which can be used directly for building Qt application, is located in sysroots/x86_64-pokysdk-linux/usr/bin/qmake.

To use the toolchain for more generic cross-development, you need to set up the environment by sourcing the environment setup script from the toolchain. For more information, see the Yocto Project documentation.

Available under certain Qt licenses.
Find out more.