C
Building QBSP with Yocto
Qt Board Support Package (QBSP) is an extension to the Qt online installer using Qt Installer Framework. It provides a way to deliver and install additional content that is not directly available from the online repositories.
A QBSP contains a cross-compilation toolchain that gets integrated into Qt Creator, and a device image that can be used to boot your device using Boot to Qt Software Stack.
Note: Before you can build QBSP files, you must set up your environment. For more information, see Setting Up Environment for Building Boot to Qt.
Building a QBSP with Yocto
The creation of QBSP is integrated into the Yocto meta layer (meta-boot2qt
) which is used for creating both the toolchain and the device image. In short, a QBSP for Boot to Qt is generated when issuing a following bitbake command:
bitbake meta-b2qt-embedded-qbsp
This builds both the toolchain (meta-toolchain-b2qt-embedded-qt6-sdk
) and the image (b2qt-embedded-qt6-image
), and then packages them into a QBSP file. The generated QBSP file is located in the tmp/deploy/qbsp/
directory in Yocto build environment.
The QBSP packaging respects the SDKMACHINE
variable. For example, if SDKMACHINE
is set to x86_64-mingw32
, a Windows toolchain will be packaged into the QBSP.
QBSP Yocto Recipes and Classes
The base class to use for QBSP creation is qbsp.bbclass
. Boot to Qt Software Stack is using it in meta-b2qt-embedded-qbsp.bb
recipe, but you can also use it in your own recipe. The bbclass is available in meta-boot2qt layer which can also be used with other Yocto distros. qbsp.bbclass
provides variables to control the creation of a QBSP. These are useful when a target hardware has not been integrated into Boot to Qt Software Stack, or there is a need to modify specific aspects of a package.
QBSP Variable | Purpose | Usual value in Boot to Qt |
---|---|---|
QBSP_SDK_TASK | Task for creating the external SDK included in the QBSP. | meta-toolchain-b2qt-embedded-qt6-sdk |
QBSP_IMAGE_TASK | Task for creating the device image included in the QBSP. | b2qt-embedded-qt6-image |
QBSP_IMAGE_CONTENT | List of files and directories that are packaged as part of the QBSP device image. | ${IMAGE_LINK_NAME}.${DEPLOY_CONF_IMAGE_TYPE} ${IMAGE_LINK_NAME}.conf ${QBSP_README} |
QBSP_NAME | Base name for the QBSP, visible in the installer description. | Boot2Qt ${QT_VERSION} |
QBSP_INSTALLER_COMPONENT | Unique component name. This string determines where in the installer tree the component is placed in relation to other components. With the default value, the tree is constructed as follows:Boot to Qt Software Stack └ Boot to Qt Software Stack ${QT_VERSION} └ ${DEPLOY_CONF_NAME} | embedded.b2qt.${QTVERSION}.yocto.${MACHINE} |
DEPLOY_CONF_NAME | Descriptive name for the target machine. Defaults to ${MACHINE} . | [device vendor] [device model] |
DEPLOY_CONF_IMAGE_TYPE | Image type for IMAGE_LINK_NAME, such as img, wic or wic.xz. | wic.xz |
QBSP_INSTALL_PATH | Location under the Qt SDK where the files are installed. | /${PV}/Boot2Qt/${MACHINE} |
QBSP_LICENSE_FILE | If a separate license agreement needs to be accepted before installation, this variable defines the file that contains the license text. | Depends on ${MACHINE} |
QBSP_LICENSE_NAME | Descriptive name for the license shown in the installer. | Depends on ${MACHINE} |
QBSP_README | A file containing installation instructions for the device. See qbsp-readme.bb recipe for more details. | README |
meta-b2qt-embedded-qbsp
is the meta-recipe that builds the QBSPs with Boot to Qt image and toolchain. It inherits qbsp.bbclass
and sets dependencies to the selected image and toolchain recipes. In addition, it sets variables to control the install locations and how the content is displayed in the Qt online installer.
Verifying QBSP Build
After you have built the QBSP file, you can verify it with the Qt online installer. If the QBSP file was successfully created, you can load it into the installer and install the QBSP's content.
Verify your QBSP build as follows:
- Launch the Qt online installer.
- Follow the instructions in the wizard until you reach the Select Components page.
- Select Browse QBSP Files (1).
- Browse to your QBSP file and select Open.
- Content of your QBSP file appears in the tree view.
- Select the component(s) to be installed and follow instructions in the wizard.
You should be able to find the installed QBSP content under your <Qt installation directory>.
Available under certain Qt licenses.
Find out more.