How to create "groups" of machines for use in machine-specific overrides?

146 Views Asked by At

Say I have multiple custom machines defined in my BSP layer's conf/machine directory.

When writing recipes, sometimes I use machine-specific overrides, like:

SRC_URI = "file://default.cfg"
SRC_URI:foo-machine = "file://special.cfg"
SRC_URI:bar-machine = "file://special.cfg"

Is there a way I can define a "group" or "subset" of machines in such a way that my overrides can reference the group, and then I easily add or remove certain machines to that virtual group without updating all of the recipes?

I am using the 'kirkstone' version branch.

2

There are 2 best solutions below

0
On BEST ANSWER

I found a way with an override set to your machine group name in configuration of each machine you want in that set.

For example :

in your foo-machine.conf and bar-machine.conf add this line :

MACHINEOVERRIDES =. "machine-group:"

then you can use this override in your recipes :

SRC_URI:append:machine-group = "file://machine-group.cfg"
SRC_URI:append:foo-machine = "file://foo-machine.cfg"
SRC_URI:append:bar-machine = "file://bar-machine.cfg"
0
On

Some workaround assuming common subsequence in machine name:

include ${@'your_appends.inc' if 'common' in d.getVar('MACHINE') else ''}