Skip to contentSkip to conversation

conf/layer.conf is broken

DISCUSSION Mark Hatle 2 participants 2 messages May 15, 2019 – May 16, 2019

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

A recent commit:

http://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/commit/conf/layer.conf?id=032ef5310419563a01baad0b1b94e4587d12f777

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:

https://github.com/WindRiver-OpenSourceLabs/meta-overc/blob/wr-10.19-20190121/meta-cube/conf/layer.conf

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:

https://github.com/WindRiver-OpenSourceLabs/meta-overc/blob/wr-10.19-20190121/meta-cube/classes/cube-cfg.bbclass

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

#1 lore raw

Mark,

Quoted 41 lines · Mark Hatle

A recent commit:

http://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/commit/conf/layer.conf?id=032ef5310419563a01baad0b1b94e4587d12f777

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:

https://github.com/WindRiver-OpenSourceLabs/meta-overc/blob/wr-10.19-20190121/meta-cube/conf/layer.conf

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:

Quoted 7 lines

https://github.com/WindRiver-OpenSourceLabs/meta-overc/blob/wr-10.19-20190121/meta-cube/classes/cube-cfg.bbclass

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