Machine specific layers in yocto

流过昼夜 提交于 2019-12-03 16:36:35

You should try to make a BSP-layer to only cause any effects if any of the machines in that layer is being used.

In your example, gstreamer1.0_1.8.1.bb, you should add

COMPATIBLE_MACHINE = "^machinea$"

note, it's a regular expression, so by omitting the leading ^ and ending $, you can by mistake match similar named machines.

Also note, I changed your example of machine name A to machinea, as machines needs to be small letters.

If you're adding .bbappend files, you typically have them modify the build by eg.

SOME_VAR_machinea

If you're overriding files, you typically put them in a structure like:

recipes-support/myrecipe/myrecipe/machinea/some-file

In this case, note the extra subdirectory machinea, which will ensure that some-file is only being used for that particular machine.

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").

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".

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).

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).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!