I am trying to build a Linux image using Yocto, and I want to run a simple Qt6 application with it on a Raspberry Pi4.
I have an issue after starting to build ($ bitbake custom-image). It says, that my .cpp and .pro file, which I have drawn from my Qt Creator project, cannot be fetched, see error log below.
WARNING: qtexample-0.1-r0 do_fetch: Failed to fetch URL file://qtexample.pro, attempting MIRRORS if available
ERROR: qtexample-0.1-r0 do_fetch: Fetcher failure: Unable to find file file://qtexample.pro anywhere. The paths that were searched were:
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/poky
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/poky
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/poky
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/raspberrypi4
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/raspberrypi4
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/raspberrypi4
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/armv7ve
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/armv7ve
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/armv7ve
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/rpi
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/rpi
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/rpi
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/arm
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/arm
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/arm
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/
/home/bkeohane/Projekte/yocto/build-rpi/downloads
ERROR: qtexample-0.1-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'file://qtexample.pro')
ERROR: Logfile of failure stored in: /home/bkeohane/Projekte/yocto/build-rpi/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/qtexample/0.1-r0/temp/log.do_fetch.148341
ERROR: Task (/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample_0.1.bb:do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2501 tasks of which 2499 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample_0.1.bb:do_fetch
I have included the meta-qt6 layer, and the openembedded layer. All my layers are in the correct branch for yoctio version (kirkstone) and I use Qt6.5 LTS branch in meta-qt6.
My custom-image.bb file is inside /meta-custom/receipe-core/images and looks as follows:
SUMMARY = "Custom Linux image."
IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
IMAGE_LINGUAS = " "
LICENSE = "MIT"
inherit core-image
# Set rootfs to 200 MiB by default
IMAGE_OVERHEAD_FACTOR ?= "1.0"
IMAGE_ROOTFS_SIZE ?= "204800"
IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}"
# Include Qt example application
IMAGE_INSTALL += "qtexample"
My qtexample_0.1.bb recipe, to build the application in the layer, is located at /meta-custom/recipe-apps/qtexample/qtexample_0.1.bb and looks as follows:
SUMMARY = "QT Example Recipe"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://qtexample.pro \
file://qtexample.cpp"
DEPENDS += "qtbase"
RDEPENDS_${PN} += "qtwayland"
S = "${WORKDIR}"
inherit qt6-qmake
Inside /qtexample, there is /qtexample/file, where my .cpp and .pro files from the Qt creator app live.
As you can see in the error message, Bitbake tried a list of paths to find your file file://qtexample.pro
, one of them is:
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/
So, you need files
and not file
, you should have the following structure in your meta-custom
:
meta-custom/
`-- recipes-apps/
`-- qtexample/
|-- qtexample_0.1.bb
`-- files/
|-- qtexample.pro
`-- qtexample.cpp
NOTE 1: Your path is incorrect:
.. is located at /meta-custom/recipe-apps/qtexample/qtexample_0.1.bb ..
^
| HERE it should be recipes-apps
NOTE 2: Generally when having local files for your recipe, you can put them in one of the following:
files
: In your case: meta-custom/recipes-apps/qtexample/files
${PN}
: In your case: meta-custom/recipes-apps/qtexample/qtexample
${PN}-${PV}
: In your case: meta-custom/recipes-apps/qtexample/qtexample-0.1
As you can see that bitbake tried those 3 paths:
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample-0.1/
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/qtexample/
/home/bkeohane/Projekte/yocto/meta-custom/recipes-apps/qtexample/files/
Other custom folder names should be added to FILESEXTRAPATHS
, example (folder: custom-folder
), with:
FILESEXTRAPATHS:prepend := "${THISDIR}/custom-folder:"