conf/layer.conf is broken
A recent commit:
refactor for YP Compat for PV changes
Only include our versions of recipes if virtualiztions is in DISTRO_FEATURE
Is not working the way that it looks like it should, specifically there are two issues:
require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'meta-virt-default-versions.inc', '', d)}
First issue is that the 'meta-virt-default-version.inc' file isn't in the same path as the layer.conf, so it really should be "conf/distro/include/meta-virt-default-version.inc"... but you may be wondering why nobody has complained about this.
The 'DISTRO_FEATURES' will -never- contain 'virtualization' unless the user calls this from within the toaster or uses bitbake -r <config> to build their system. The problem is that 'requires' are evaluated IMMEDIATELY, and DISTRO_FEATURES is not set in the layer.conf path. It's set later via distributions and such by the eventual load of the bitbake.conf file(s).
So there is a trick to be able to do this. You need to find a way to 'late' load these files, AFTER bitbake.conf is loaded. We had to do exactly this from within the meta-overc/meta-cube layer:
You will see at the end that a variable is set to the config file to load, and that the USER_CLASSES is appended with something that (CAN) check the distro_features -- because it's resolved 'later'. Then the class simply does a require bringing in the configuration itself:
meta-virtualization SHOULD be able to follow the same approach to be able to make these adjustments without breaking any of the Yocto Project compatible guidelines. (Unfortunately I don't have time to work on that myself right now, but hopefully someone else can step in and fix this.)
--Mark
Mark,
Quoted 41 lines · Mark Hatle
A recent commit:
refactor for YP Compat for PV changes
Only include our versions of recipes if virtualiztions is inDISTRO_FEATURESigned-off-by Armin Kuster <[email protected]>Signed-off-by Bruce Ashfield <[email protected]>Is not working the way that it looks like it should, specifically there are two issues:
require ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', 'meta-virt-default-versions.inc', '', d)}
First issue is that the 'meta-virt-default-version.inc' file isn't in the same path as the layer.conf, so it really should be "conf/distro/include/meta-virt-default-version.inc"... but you may be wondering why nobody has complained about this.
The '
DISTRO_FEATURES' will -never- contain 'virtualization' unless the user calls this from within the toaster or uses bitbake -r <config> to build their system. The problem is that 'requires' are evaluated IMMEDIATELY, andDISTRO_FEATURESis not set in the layer.conf path. It's set later via distributions and such by the eventual load of the bitbake.conf file(s).So there is a trick to be able to do this. You need to find a way to 'late' load these files, AFTER bitbake.conf is loaded. We had to do exactly this from within the meta-overc/meta-cube layer:
You will see at the end that a variable is set to the config file to load, and that the
USER_CLASSESis appended with something that (CAN) check thedistro_features-- because it's resolved 'later'. Then the class simply does a require bringing in the configuration itself:
Quoted 7 lines
meta-virtualization SHOULD be able to follow the same approach to be able to make these adjustments without breaking any of the Yocto Project compatible guidelines. (Unfortunately I don't have time to work on that myself right now, but hopefully someone else can step in and fix this.)
Thanks for the explanations. I will see if I can work on a patch.
safe travels,
armin
Quoted 1 line
--Mark