I maintain a custom Yocto meta layer compatible with Dunfell. It supports a Microchip SAMA5D27 processor based board. I have several bbappend files in this layer that apply only to file from the meta-atmel and other Microchip specific packages.
Now, I want to re-use many parts of this custom meta layer and support a new processor from a different vendor. I have created my own new image recipe in my layer that does not include these bbappend files that are only relevant to Microchip.
The problem is that Yocto throws as error 'No recipes available for' regarding my bbappend files. The error seems to happen during parsing and does not consider whether I use the recipe or not in the current target.
I have searched extensively for a solution, but so far have come up empty. How can I use 1 meta-layer and maintain different bbappend files, while being able to switch MACHINE variables for different target builds?
Bitbake Version:
root@buildmachine:/$ bitbake --version
BitBake Build Tool Core version 1.46.0
I have tried to use the COMPATIBLE_HOST and COMPATIBLE_MACHINE variables in these bbappend files, but the error remains.
# Only compatible with sama5d27 microchip
COMPATIBLE_HOST = "arm-poky-linux-musleabi"
COMPATIBLE_MACHINE = "sama5d27-wlsom1-ek-sd"
Error output:
root@buildmachine:~/Desktop/compulab/build-cmdline$ MACHINE=iot-gate-imx8 bitbake iot-gate-imx8-image
WARNING: Host distribution "ubuntu-20.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |#######################################################################################################################################################| Time: 0:00:01
Loaded 4938 entries from dependency cache.
ERROR: No recipes available for:
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-bsp/at91bootstrap/at91bootstrap_3.10.0.bbappend
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-bsp/dt-overlay-at91/dt-overlay-at91_git.bbappend
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-bsp/libubootenv/libubootenv_%.bbappend
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-bsp/u-boot/u-boot-at91_2020.01.bbappend
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-core/initrdscripts/initramfs-debug_%.bbappend
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-httpd/nginx/nginx_%.bbappend
/home/me/Desktop/compulab/sources/meta-proprietary/recipes-kernel/linux/linux-at91_5.4.bbappend
The issue as you've discovered is that Yocto is unable to match the .bbappend
files to any recipes when you switch to another MACHINE
.
You can solve the problem by conditionally including your .bbappend
files only if particular layers are enabled. Yocto supports this through the BBFILE_DYNAMIC variable.
For instance, if you keep your .bbappend
files in the dynamic-layers/meta-atmel
folder within your own layer, and you only want to include those .bbappend
files if meta-atmel
is in use, then add the following to your layer.conf
:
BBFILES_DYNAMIC += "\
meta-atmel:${LAYERDIR}/dynamic-layers/meta-atmel/recipes-*/*/*.bbappend \
meta-atmel:${LAYERDIR}/dynamic-layers/meta-atmel/recipes-*/*/*/*.bbappend \
"
(adjust paths / folder depth as appropriate).
This says that if meta-atmel
is included in the list of layers, then add the two dynamic-layers/...
paths to the search path.