yocto - bitbake 中的继承澄清

标签 yocto bitbake

在bitbake中,当使用require关键字添加包含文件时,继承是否可以在包含文件之间转移?或者我们是否需要在每个包含文件中一遍又一遍地重用inherit关键字?我正在使用 Bitbake 和 Yocto 构建图像。

exampleA.inc 文件

inherit exampleC

exampleB.inc 文件

require exampleA.inc

那么,如果我也希望 exampleB.inc 继承自 exampleC,是否需要在此文件中指定它?

假设 exampleC 是 bbclass 文件。

最佳答案

TLDR:一个继承语句就足够了。

requireinclude 只是将指定文件的内容插入到配方中的当前位置。这会产生相同的结果,就好像您已将 .inc 文件的全部内容写入配方中一样。多层 include/require 不应改变这一点。这意味着,不是 .inc 文件继承自 exanpleC,而是配方,它需要所述 .inc 文件。

我还进行了一些快速测试来证实这个理论,这一切似乎都有效。

不要被 BitBake 文档中的说明吓倒:

[...] you can use the inherit directive to inherit the functionality of a class (.bbclass). BitBake only supports this directive when used within recipe and class files (i.e. .bb and .bbclass).

这并不意味着它不适用于 .inc 文件,而是不适用于配置文件。

关于yocto - bitbake 中的继承澄清,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74974925/

相关文章:

linux - Yocto 构建在 gcc 和硬 fpu 问题上崩溃

git - Bitbake (Yocto) git fetch URI 认证

c++ - 在 yocto 中编译 c++ 程序

yocto - 如何从 bitbake 构建的最终 rootfs 镜像中删除特定包

linux - 安装自签名证书 Linux yocto

yocto - 如何在具有多个包的 Bitbake 配方中指定包版本?

embedded-linux - 在 Yocto 中启用 systemd 服务

linux - 从 Yocto build 手动构建内核源代码

c++ - 将 qcharts 模块安装到 yocto sdk

linux - bitbake 期间出现“ fatal error : linux/compiler-gcc5. h:没有此类文件或目录”