Conditional selection based on layers
We can use BBFILE_COLLECTIONS
to conditionally decide which recipes to include in our BBFILES
. To do this, we need to use logic that is similar to the following in our layer.conf
:
- Firstly, add the following two lines to our
layer.conf
file:BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes-*/*/*.bbappend' % layer \ for layer in BBFILE_COLLECTIONS.split())}" BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes-*/*/*.bb' % layer \ for layer in BBFILE_COLLECTIONS.split())}"
- Secondly, arrange your
recipes-*
directories under directories named according to other layers found inBBFILE_COLLECTION
. For example, we might need to add some metadata that is specific only to it, and we want it applied only when we havemeta-ti
included in ourbblayers.conf
file. What we will do in this case is create a directory under our layer—say,test/meta-t/
—and move all of therecipe...