Search code examples
qtstm32embedded-linuxyoctoyocto-recipe

How to find the custom recipe created in yocto inside my embedded linux image


I created a st-image-qt image using the STM32MP Distribution package and X-LINUX-QT add-on for the STM32MP157F-DK2 board.

I could flash this image using the dd command in Linux and my target board is running correctly.

On the other side, I created a qt quick app using qt 6.7.3(which I could test ok using qt creator) and now I need to add this qt app in my st-image-qt image. I can bitbake this custom recipe doing "bitbake mygui"

I created the custom layer and a custom recipe and added this custom layer to my bblayers. Then, I built the image again with this custom recipe and it worked ok.

The problem is that I'm expecting to find this qt app inside my bin directory, but I can't see it.

SUMMARY = "This is the GUI for Hespect Software medical device"
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "CLOSED"
SECTION = "Mysection"

DEPENDS += " qtbase \
             qtdeclarative-native \
             qtdeclarative \
             qtquick3d \
             qtcharts"
             
RDEPENDS_${PN} += "qtwayland"

EXTRA_OECMAKE += "-DCMAKE_PREFIX_PATH=${STAGING_DIR_HOST}${prefix}"

SRC_URI += "file://main.cpp"
SRC_URI += "file://CMakeLists.txt"
SRC_URI += "file://CMakeLists.txt.user"
SRC_URI += "file://Backendsensors.h"
SRC_URI += "file://Backendsensors.cpp"
SRC_URI += "file://brushfactory.h"
SRC_URI += "file://brushfactory.cpp"
SRC_URI += "file://Main.qml"

# Add SVG images from the assets/images folder
SRC_URI += "file://assets/images/battery-full.svg"
SRC_URI += "file://assets/images/battery-mid.svg"
SRC_URI += "file://assets/images/rss-low.svg"
SRC_URI += "file://assets/images/signal-full.svg"
SRC_URI += "file://assets/images/signal-mid.svg"
SRC_URI += "file://assets/images/battery-low.svg"
SRC_URI += "file://assets/images/rss-full.svg"
SRC_URI += "file://assets/images/rss-mid.svg"
SRC_URI += "file://assets/images/signal-low.svg"

            
S = "${WORKDIR}/mygui"

do_install () {
    install -d ${D}${bindir}
    install -m 0775 mygui ${D}${bindir}/
}

FILES_${PN} += "${bindir}/mygui"

inherit cmake_qt5

In my local conf file I added: IMAGE_INSTALL_APPEND += "mygui"


Solution

  • Adding IMAGE_INSTALL_APPENDin the local conf seems to be the problem.

    Try to add the recipe to the image you are building. In one of the layers there should be a st-image-qt.bb file. It should be in <layername>/recipes-core/images. There, you have to add it with IMAGE_INSTALL:append = " mygui " (Note the space after the "). Only then the recipe is included in the image, only adding the layer is not enough.

    Note that this is not a very pretty solution. You should create your own image.bb file in your own layer, and add your application there.