简体   繁体   English

Yocto Dunfell 错误“没有可用的食谱”在单个自定义元层中使用多台机器

[英]Yocto Dunfell error 'No recipes available for' with multiple machines in single custom meta layer

I maintain a custom Yocto meta layer compatible with Dunfell.我维护了一个与 Dunfell 兼容的自定义 Yocto 元层。 It supports a Microchip SAMA5D27 processor based board.它支持基于 Microchip SAMA5D27 处理器的板。 I have several bbappend files in this layer that apply only to file from the meta-atmel and other Microchip specific packages.我在这一层有几个 bbappend 文件,它们仅适用于 meta-atmel 和其他 Microchip 特定包中的文件。

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.我在我的层中创建了自己的新图像配方,其中不包含这些仅与 Microchip 相关的 bbappend 文件。

The problem is that Yocto throws as error 'No recipes available for' regarding my bbappend files.问题是 Yocto 抛出关于我的 bbappend 文件的错误“没有可用的食谱”。 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?如何使用 1 个元层并维护不同的 bbappend 文件,同时能够为不同的目标构建切换 MACHINE 变量? Thanks!谢谢!

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.我尝试在这些 bbappend 文件中使用 COMPATIBLE_HOST 和 COMPATIBLE_MACHINE 变量,但错误仍然存在。

# Only compatible with sama5d27 microchip
COMPATIBLE_HOST = "arm-poky-linux-musleabi"
COMPATIBLE_MACHINE = "sama5d27-wlsom1-ek-sd"

Error output:错误 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 .您发现的问题是,当您切换到另一台MACHINE时,Yocto 无法将.bbappend文件与任何食谱匹配。

You can solve the problem by conditionally including your .bbappend files only if particular layers are enabled.只有在启用特定层时,您才能通过有条件地包含.bbappend文件来解决问题。 Yocto supports this through the BBFILE_DYNAMIC variable. Yocto 通过BBFILE_DYNAMIC变量支持这一点。

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 :例如,如果您将.bbappend文件保存在您自己层内的dynamic-layers/meta-atmel文件夹中,并且您只想在使用meta-atmel时包含这些.bbappend文件,则将以下内容添加到您的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.这表示如果meta-atmel包含在层列表中,则将两个dynamic-layers/...路径添加到搜索路径。

You cannot append to a recipe that does not exist in the first place.你不能 append 到一个根本不存在的配方。

If the recipes exist:如果配方存在:

  • at91bootstrap_3.10.0.bb at91bootstrap_3.10.0.bb
  • dt-overlay-at91_git.bb dt-overlay-at91_git.bb
  • ... ...

make sure that their layer is added to bblayers.conf.确保他们的层被添加到 bblayers.conf。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM