yocto中的机器特定图层 [英] Machine specific layers in yocto

查看:125
本文介绍了yocto中的机器特定图层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为新机器添加一些从上游获取的层(称为A),主要是为了使用这些层提供的机器A配置文件,内核和u-boot.但是,新层有几个bbappend文件(也有bb文件),其版本与我的yocto项目中其他机器的层不同.

I want to add some layers fetch from upstream for a new machine (call it A) mainly just to use the machine A configure file, kernel and u-boot provided from those layers. However, the new layers have several bbappend files (with bb files as well) that the version is different with other machines' layers in my yocto project.

例如,计算机A 具有自己的 gstreamer1.0_1.8.1.bb 和bbappend文件. 其他计算机正在使用 gstreamer1.0_1.6.1.bb .当我为另一台计算机构建映像时会发生什么,因为它构建了1.8.1版本,因为Yocto会一直寻找并兼容包的最新兼容版本.但是,gstreamer1.0_1.8.1.bbappend文件是专门为机器A编写的,不适用于其他机器,并且会导致错误.不仅是gstreamer,还有更多.

For example, machine A has its own gstreamer1.0_1.8.1.bb and bbappend file. Other machines are using gstreamer1.0_1.6.1.bb. What happens when I build the image for the other machine is that it builds the version 1.8.1 because Yocto will always look for the newest compatible version of package and build it. However, the gstreamer1.0_1.8.1.bbappend file is written specifically for machine A, does not apply to others and causing errors. Not only the gstreamer, there are more.

我在bblayers.conf文件中有一个类似于BBLAYERS_A += "new_layers \ ..."的想法,但不幸的是,它并没有达到我想要的方式.

I got an idea like BBLAYERS_A += "new_layers \ ..." in the bblayers.conf file, but unfortunately it does not work the way I want it to.

我的另一个想法是:

BBMASK_B = "new_layers \ ..."
BBMASK_C = "new_layers \ ..."
BBMASK_D = "new_layers \ ..."
BBMASK_E = "new_layers \ ..."
BBMASK_F = "new_layers \ ..."
BBMASK_G = "new_layers \ ..."
BBMASK_H = "new_layers \ ..."
BBMASK_I = "new_layers \ ..."
...

它对我来说看起来不太好,我怀疑它也不能正常工作.我认为构建过程是先加载bblayers.conf文件,然后加载local.conf.因此,在知道要构建的机器之前,已经部署了各层.

It doesn't look good to me and I doubt it won't work as well. I think the build procedure is to load the bblayers.conf file first, then the local.conf. Therefore, before knowing what machine it is going to build, the layers are deployed.

我的问题是我该如何使这些新添加的图层仅可用于机器A ,而不会被其他机器使用.

My question is how can I make those newly added layers that work with machine A only, but won't get used by the other machines.

推荐答案

最适合我的解决方案是使用(或BBMASK = "layers that not for A").

The solution that works for me is to use DISTRO feature from yocto. It is flexible. What I did is to use different DISTRO for machine_A (meaning using a different configuration file for A), then include a MACHINE_A.inc with BBMASK = "" (or BBMASK = "layers that not for A").

在默认的Poky DISTRO的bblayers.conf文件中,我使用BBMASK = "all machine_A's layers"阻止了machine_A引入的所有图层.

In the default Poky DISTRO, inside the bblayers.conf file, I block all layers introduced by machine_A by using BBMASK = "all machine_A's layers".

在local.conf中,我设置了DISTRO_machine_A = "MACHINE_A",因此在为machine_A构建映像时,bitbake将查看DISTRO并找到machine_A的配置文件,这将重置全局BBMASKmachine_A本身启用图层(甚至阻止其他图层).

In the local.conf, I set DISTRO_machine_A = "MACHINE_A", so when building the image for machine_A, bitbake will look into DISTRO and find the configuration file for machine_A, which will reset the global BBMASK to enable layers for machine_A itself (or even to block other layers).

通过使用DISTRO,我可以为不同的机器获得一个单独的构建环境,同时在项目中引入新的层.有点像BBMASK_machine_A(BBMASK_machine_A实际上不会像我描述的问题那样起作用).

By using DISTRO, I am able to get a separate build environment for different machines while introducing new layers into the project. Kind of like BBMASK_machine_A (BBMASK_machine_A won't actually work as my question described).

这篇关于yocto中的机器特定图层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆