Embedded Software - Yocto recipes dependency a screenshot of a computer

Yocto recipes dependencies

How to get dependencies between recipe variables

Do you ever create an override of recipe variables in your custom meta-layer and nothing happens?

Don't doubt yourself and have a look at the priority of the used meta-layers.

Example

We want to build a Yocto Linux distro for Raspberry Pi 4 and change the background image of psplash recipe. To do that, we create a folder 'psplash' in our custom meta-layer 'meta-interelectronix' and add the file 'psplash_%.bbappend' to override the variables of 'SPLASH_IMAGES'.

SPLASH_IMAGES:rpi = "file://psplash-ixlogo-white-img.h;outsuffix=raspberrypi"

After adding 'meta-interelectronix' to 'bblayers.conf', we bitbake the Linux distro, flash it to an SD card and boot the Raspberry Pi 4 with it.

But no custom background image for the splash screen was used - why that?

What causes this behavior?

After searching for the 'error', we have a look at the priority variable of the meta-layers. Meta-layers have a variable for the priority to define in which rank the meta-layer is used when bitbaking the Linux distro.

The variable is set in the file 'meta-interelectronix/conf/layer.conf':

BBFILE_PRIORITY_meta-interelectronix = "6"

In our case, the priority of 'meta-interelectronix' was set to '6' and the priority of 'meta-raspberrypi' is set to '9'.

The higher the priority, the later were the variables of bbappend files applied to bitbake. As in 'meta-raspberrypi' also is a 'psplash_%.bbappend' file, the variables of this file override the overrides in our 'meta-interelectronix' layer again, an nothing changes.

Note

Change the priority of your custom meta-layer to a high number, e.g. 50, to apply your changes later as all overrides of foreign meta-layers.

How to get easy the ranking of variables?

There is an easy command to get the ranking of a variable over all meta-layers:

bitbake-getvar -r recipe VARIABLE

In our case, the command was:

bitbake-getvar -r psplash SPLASH_IMAGES

The result after changing the priority of 'meta-interelectronix' layer to '50' looks like this:

bitbake-getvar -r psplash SPLASH_IMAGES
#
# $SPLASH_IMAGES [4 operations]
#   set /workdir/poky-kirkstone/meta/recipes-core/psplash/psplash_git.bb:19
#     "file://psplash-poky-img.h;outsuffix=default"
#   set /workdir/poky-kirkstone/meta-interelectronix/recipes-core/psplash/psplash_%.bbappend:10
#     "file://psplash-ixlogo-white-img.h;outsuffix=interelectronix"
#   override[rpi]:set /workdir/poky-kirkstone/meta-raspberrypi/recipes-core/psplash/psplash_%.bbappend:2
#     "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"
#   override[rpi]:set /workdir/poky-kirkstone/meta-interelectronix/recipes-core/psplash/psplash_%.bbappend:9
#     "file://psplash-ixlogo-white-img.h;outsuffix=raspberrypi"
# pre-expansion value:
#   "file://psplash-ixlogo-white-img.h;outsuffix=raspberrypi"
SPLASH_IMAGES="file://psplash-ixlogo-white-img.h;outsuffix=raspberrypi"

You can also show the priority of the used layers with the following command:

bitbake-layers show-layers

Copyright License

Copyright © 2022 Interelectronix e.K.
This Project source code is licensed under the GPL-3.0 license.