简体   繁体   English

如何在 Yocto 中覆盖 a.conf 文件

[英]How to override a .conf file in Yocto

I know how to override a .bb file using a .bbappend one inside a custom layer, replicating the exact path of the original one.我知道如何在自定义层中使用.bbappend覆盖.bb文件,复制原始文件的确切路径。

But when the file to override is a .conf ?但是当要覆盖的文件是.conf时? I'm reading the mega-manual but I cannot find this information (perhaps I'm looking at the wrong chapters).我正在阅读大型手册,但找不到此信息(也许我正在查看错误的章节)。

UPDATE更新

This is an example of what I want to do.这是我想做的一个例子。 The original.conf file contains this line: original.conf 文件包含这一行:

IMAGE_FEATURES[validitems] += "qtcreator-debug"

and I want to remove that.我想删除它。 If it were a.bb file I would create a bbappend file with:如果它是 a.bb 文件,我将创建一个 bbappend 文件:

IMAGE_FEATURES[validitems] -= "qtcreator-debug"

Basically the.conf files are evaluated top-to-bottom.基本上 .conf 文件是从上到下评估的。 So you can always overwrite anything, and the exactly evaluation order is listed whenever you run bitbake -e on something, plus there is a verbose rundown of evalutaion on each variable too.因此,您始终可以覆盖任何内容,并且每当您对某物运行bitbake -e时,都会列出确切的评估顺序,此外,每个变量也有一个详细的评估清单。

So, thats the one part.所以,这就是一部分。 The other is, proper.conf files actually set their variables that are meant to be tuned with the ?= and ??= operators, which makes it easier to overwrite.另一个是,proper.conf 文件实际上设置了它们的变量,这些变量旨在使用?=??=运算符进行调整,这使得覆盖更容易。 So if the to-be-overwritten.conf is one that you are maintaining, consider rewriting it.因此,如果 to-be-overwritten.conf 是您正在维护的,请考虑重写它。 If not, also think about why it maybe has not been written that way, and if overwriting it is actually the right solution or merely a duct tape solution.如果不是,还要想想为什么它可能没有这样写,如果覆盖它实际上是正确的解决方案,或者仅仅是一个管道胶带解决方案。

There are multiple ways of doing this.有多种方法可以做到这一点。 1) You can always override stuff in the local.conf, it has the highest evaluation priority. 1)你总是可以覆盖local.conf中的东西,它具有最高的评估优先级。 But the limitation is that the local.conf needs to be manually edited and changes are available only to the build with that specific local.conf.但限制是 local.conf 需要手动编辑,并且更改仅适用于具有特定 local.conf 的构建。 2) If it makes sense, you can create a new conf file and inherit the original conf file using "require" and then override stuff. 2)如果有意义,您可以创建一个新的conf文件并使用“require”继承原始conf文件,然后覆盖东西。 This is useful while creating new machine conf files based on the existing ones.这在基于现有文件创建新机器 conf 文件时很有用。 3) Finally, a brute force mechanism to override the complete conf file is to create a new conf file with the same name inside the custom layer, and setting the layer priority of the custom layer higher than the layer containing the original conf file. 3)最后,覆盖整个conf文件的蛮力机制是在自定义层内部新建一个同名的conf文件,并将自定义层的层优先级设置为高于包含原始conf文件的层。 This means you'd have to maintain the overriding conf file yourself.这意味着您必须自己维护覆盖的 conf 文件。 This method is applicable for overriding bbclasses as well.此方法也适用于覆盖 bbclasses。 4) You can modify the IMAGE_FEATURES inside the image recipe as well (see http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-sato/images/core-image-sato.bb ). 4)您也可以修改图像配方中的 IMAGE_FEATURES(参见http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-sato/images/core-image-sato.bb )。

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

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