0

I am trying to install a custom application on my Yocto build.

I currently use a Raspberry Pi 4 64 bit setup, for which I want PyQt5 to display an application directly on the frame buffer (so no windowing manager or desktop envoirement).

My current build with Yocto completes and boots on the Raspberry Pi. All the Qt5 libraries are also present in the root fs after the bitbake build.

Although, I'm having problems getting a custom layer, that adds a custom recipe with a custom application to also copy over to the destination root fs.

My custom layer is called 'meta-rpikms' with recipe 'recipes-kms-qt-app' which contains the application bb files. This files is called 'basicquick_0.1.bb' and has the following contents (this test application tries to add a EGLFS friendly Qt5 applicaiton, i'll try PyQt5 later):

SUMMARY = "Simple Qt5 Quick application"
#SECTION = "examples"
LICENSE = "MIT"
#PACKAGE_ARCH = "all"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
DEPENDS += "qtbase qtdeclarative qtquickcontrols2"
SRCREV = "${AUTOREV}"
SRC_URI = "git://github.com/shigmas/BasicQuick.git"

S = "${WORKDIR}/git"

require recipes-qt/qt5/qt5.inc



do_install() {
      install -d ${D}${bindir_native}
      install -m 0755 BasicQuick ${D}${bindir_native}
}
FILES_${PN} += "${bindir_native}"

When I bitbake the custom layer of my meta-rpikms (called 'qt5-kms-rpi-image'), it does compute. When I take a look at the 'image_initial_manifest' file, my custom application does show up, suggesting that it does compile and try to install the application:

# This file was generated automatically and contains the packages
# passed on to the package manager in order to create the rootfs.

# Format:
#  <package_type>,<package_name>
# where:
#   <package_type> can be:
#      'mip' = must install package
#      'aop' = attempt only package
#      'mlp' = multilib package
#      'lgp' = language package

mip,basicquick
mip,bluez5
mip,bridge-utils
mip,hostapd
mip, bla bla bla etc etc etc.

And if I take a look in: '~/builds/pyqt5_try1/poky/rpi64-build/tmp/work/cortexa72-poky-linux/basicquick/0.1-r0', the expected files do show up. Also suggesting that it does atleast build the application. This makes the think that the 'install' arguments in my .bb file are pointing to the wrong folder.

In my basicquick_*.bb file this is to make the directory and install (copy) the built files:

install -d ${D}${bindir_native}
install -m 0755 BasicQuick ${D}${bindir_native}

I used the 'bitbake -e' command to trace the variable D and bindir_native:

D="/home/mats/builds/pyqt5_try1/poky/rpi64-build/tmp/work/raspberrypi4_64-poky-linux/qt5-kms-rpi-image/1.0-r0/image"

bindir_native="/usr/bin"

This seems okay at first glance, but when I manually follow the destination of the variable 'D', there is no 'images' folder created. I also wonder why everybody installs their custom applications on ${D}/usr/bin? Should this not be written to the build/tmp/deploy directory? Or am I missing a step here.

So, in this 'qt5-kms-rpi-image/1.0-r0' folder, there is a folder called 'deploy-qt5-kms-rpi-image-image-complete', which contains a rootfs. But there also is a rootfs folder in the 'qt5-kms-rpi-image/1.0-r0' folder. Both of these rootfs's do not contain any mention of my basicquick application, or a BasicQuick folder being created in /usr/bin.

Also, the rootfs found in the "build/tmp/deploy/images/raspberrypi4-64/qt5-kms-rpi-image-raspberrypi4-64.tar.bz2" does not contain any mention of the basicquick application being present in the filesystem.

Does anybody have any clues on what I am missing? Am I just not copying my files to the correct location? Or does the final deploy image end up somewhere else from where I am expecting it?

Thanks in advance.

With kind regards,
Mats de Waard

Mats de Waard
  • 139
  • 2
  • 15
  • Try to mention everything under `${D}`: `FILES_${PN} += "${bindir_native}/*"` – Talel BELHADJSALEM Feb 15 '22 at 13:12
  • @BelHadjSalem TALEL, That is my whole .bb file. Am I missing a function (or function call, for that matter)? – Mats de Waard Feb 16 '22 at 09:33
  • I think you need to modify `FILES` as I mentioned in order to specify all the files you need to include in the rootfs – Talel BELHADJSALEM Feb 17 '22 at 07:02
  • Aah okay. Seems like I misread your last comment. I also found out that the variable is called: "FILES:basicquick" in my case (so using a ":" instead of a "_"). I also found a post where someone mentioned that the FILES variable should be changed before do_install(), which I have done as well. It seems like the do_install does run correctly. It creates a directory in ${D}, called usr/bin and it contains the BasicQuick application. Although when I check the tar.bz2 that is created when I add my recipe to my image, it does not contain the app. (Although the img manifest shows BasicQuick) – Mats de Waard Feb 17 '22 at 14:02
  • It just seems like the ${D}/usr/bin is never actually deployed to the image rootfs.tar.bz2. If I check the variable: FILES:basicquick (with bitbake -e basicquick | grep ^FILES), the variable is correctly set to contain: "usr/bin/*" (like you mentioned). Am I missing a function call or something, to actually copy the files from the local recipe work folder, to the image folder? I can't seem to figure out, when or how this happens anyways. Am I missing a default function that does not get called anymore for some reason? – Mats de Waard Feb 17 '22 at 14:03
  • Go to the `package` directory under the `${WORKDIR}` of the recipe and see if there is a package (rpm, ipk or deb), check if it contains your specified files of `FILES`, if not then `do_package` is not running correctly – Talel BELHADJSALEM Feb 17 '22 at 16:52
  • Sorry for responding so late. If I check the `package` folder under the `${WORKDIR}` folder, it seems to contain my files as plain folders and files (so no .rpm, .ipk or .deb). However, if I check the folder `deploy-rpm/cortexa72` (under the `${WORKDIR}` folder), it does contain a .rpm file for each package-split (-dev, -dbg, -src). Every file is present in the main .rpm (libraries, src, debug etc), except for the main binary file (`BasicQuick`). Which leads me to believe that indeed my `do_package` does not work correctly. Does anyone have an idea on what I could try? – Mats de Waard Mar 15 '22 at 12:39
  • It also looks like my `${PN}.spec` file (the RPM 'recipe') does not contain any reference to the `/usr/bin` folder under the `%files` variable. Eventhough the `FILES:${PN}` variable in bitbake, does reference `/usr/bin/*` (when checked with `bitbake -e BasicQuick | grep ^FILES:BasicQuick`). I thought these two variables were interlinked, or am I looking in the wrong direction? Or am I maybe setting these variable too late or something like that? – Mats de Waard Mar 15 '22 at 12:56

0 Answers0