BitBake中继承指令和继承配置指令之间的区别

发布于 2025-01-30 07:06:56 字数 230 浏览 2 评论 0 原文

我是Bitbake的新手,我正在学习。

您能帮我了解继承指令与继承配置指令之间的区别吗?

我对继承指令的理解:

继承指令用于从.bbclass文件继承一个.bbclass文件到另一个.bbclass文件或.bb(配方)文件

我无法理解什么是继承配置指令?看到语法继承 +=“ ABC”。它要做什么?为什么我们有2个不同的继承指令?

提前致谢

I am new to bitbake and i am learing it.

Can you please help me understand the difference between inherit Directive and INHERIT Configuration Directive?

My understanding on inherit Directive:

inherit Directive is used to inherit a class from .bbclass file into another .bbclass file or .bb(recipe) file

I am not able to understand what is INHERIT Configuration Directive?i saw the syntax INHERIT += "abc".what is it trying to do?why do we have 2 different inherit directives?

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绮筵 2025-02-06 07:06:56

继承继承之间的差异很简单,并且在yocto文档在这里

...使用继承来继承一类有效继承类
全球

内,它们之间有两个区别:

  1. 继承范围
  • sashit 仅继承给定配方
  • sashit sasenit 在全球范围内继承该类食谱,因此所有配方都可以访问类功能或任务,这意味着如果您在该类中具有主要任务( do_install do_compile ,...),它将影响所有食谱。
  1. 执行
  • sashit 将在解析期间执行类中的任何匿名函数
  • sashit 将忽略类解析过程中的任何匿名函数(检查 link

=“ https://www.yoctoproject.org/docs/current/ref-manual/ref-manual/ref-manual.html#var-inherit >

您可以开发自己的课程,例如拥有实用程序功能,并通过多个配方在全球使用它,而不是继承为每个类使用。

The difference between inherit and INHERIT is simple and is well explained in the Yocto documentation here:

... using INHERIT to inherit a class effectively inherits the class
globally

So, there are two differences between them:

  1. Inheritance scope:
  • inherit only inherits a class for a given recipe
  • INHERIT inherits the class globally for all recipes, so all recipes have access to the classes functions or tasks, meaning if you have main tasks in that class (do_install, do_compile, ...) it will affect all recipes.
  1. Execution:
  • inherit will execute any anonymous function in the class during parsing
  • INHERIT will ignore any anonymous function in the class during parsing (check link)

NOTE

You can develop your own class for example having your utility functions and use it globally by multiple recipes rather than inheriting the class for each class.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文