How to create QBSPs from Yocto builds
December 14, 2018 by Samuli Piippo | Comments
In Qt for Device Creation 5.12.0, we have enabled additional content installation via QBSPs (Qt Board Support Packages). A QBSP combines toolchain, target device images and set of Qt Creator configurations for particular device into a single file that can be easily shared and installed using the Qt online installer or the Maintenance tool. Technically a QBSP is an archived repository created by the Qt Installer Framework, and it's creation is now fully integrated into the Yocto builds that are used to create the Boot to Qt Software Stack content.
For all the target devices currently supported in the meta-boot2qt layer, you can create a QBSP simply by issuing a bitbake command:
bitbake meta-b2qt-embedded-qbsp
This will first build both the toolchain and the image, and then package those into a QBSP file with the required Qt Creator configurations. The resulting QBSP file is located in tmp/deploy/qbsp/
folder in your Yocto build environment. The QBSP packaging respects the SDKMACHINE
variable, so that if you use environment variable SDKMACHINE=i686-mingw32
, a Windows toolchain is packaged into the QBSP.
The Yocto integration is implemented in two classes that can be used even if your target device has not been otherwise integrated into the meta-boot2qt layer. By inheriting the classes and setting up the required variables, you can have a QBSP with your own image for your own target device.
qbsp-image.bbclass
The QBSP will need a suitable device image to include in the package and to achieve this you will need to inherit qbsp-image.bbclass
in the image recipe you want to use. You can control the content of the package with variable QBSP_IMAGE_CONTENT
. By default Boot to Qt images include a .img file and a .conf file used by the Flashing Wizard.
inherit qbsp-image
QBSP_IMAGE_CONTENT = "\
${IMAGE_LINK_NAME}.img \
${IMAGE_LINK_NAME}.conf \
"
qbsp.bbclass
qbsp.bbclass
is the main class that handles the creation of the QBSP and you can control the various aspects of it through variables. Most important ones are the dependencies to the toolchain and image task using QBSP_SDK_TASK
and QBSP_IMAGE_TASK
variables.
For the Boot to Qt Software Stack, this is done in the meta-b2qt-embedded-qbsp.bb
recipe:
inherit qbsp
VERSION_SHORT = "${@d.getVar('PV').replace('.','')}"
QBSP_NAME = "Boot2Qt ${PV}"
QBSP_MACHINE = "${@d.getVar('MACHINE').replace('-','')}"
QBSP_INSTALLER_COMPONENT = "embedded.b2qt.${VERSION_SHORT}.yocto.${QBSP_MACHINE}"
QBSP_INSTALL_PATH = "/${PV}/Boot2Qt/${MACHINE}"
QBSP_SDK_TASK = "meta-toolchain-b2qt-embedded-qt5-sdk"
QBSP_IMAGE_TASK = "b2qt-embedded-qt5-image"
Rest of the variables are then used to control how the installer shows the component and where they are installed. You can optionally also, e.g., add an EULA to the package, which the user would need to accept before they can install the components. You can find this and all the other information about the QBSP specific variables in the documentation.
Blog Topics:
Comments
Subscribe to our newsletter
Subscribe Newsletter
Try Qt 6.5 Now!
Download the latest release here: www.qt.io/download.
Qt 6.5 is the latest Long-Term-Support release with all you need for C++ cross-platform app development.
Explore Qt World
Check our Qt demos and case studies in the virtual Qt World
We're Hiring
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Näytä tämä julkaisu Instagramissa.Henkilön Qt (@theqtcompany) jakama julkaisu