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.
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 wget git-core diffstat unzip p7zip-full texinfo \ gcc-multilib build-essential chrpath libsdl1.2-dev xterm gperf bison curl \ udisks screen
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.7/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:
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:
|Raspberry Pi 2||raspberrypi2|
|Raspberry Pi 3||raspberrypi3|
|Boundary Devices i.MX6 Boards||nitrogen6x|
|Freescale SABRE SD i.MX6Quad||imx6qsabresd|
|Freescale SABRE SD i.MX6Dual||imx6dlsabresd|
|Toradex Apalis iMX6||apalis-imx6|
|Toradex Colibri iMX6||colibri-imx6|
|Toradex Colibri VF||colibri-vf|
|NVIDIA DRIVE CX||tegra-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
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.
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
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.