I have a .bbappend
file within a custom Yocto Project layer (and separate repo).
I would like to place information about my custom layer (e.g. git stuff for my custom repo/layer) within a file that this .bbappend
modifies.
Any commands which are run from this .bbappend
are run as if from the .bb
file to which it appends (the .bb
is in another layer and repo as recommended).
I thought there might be some hope for running VAR := "stuff ${OTHER_VAR} more"
, which some documentation says is "immediate variable expansion" which is "expanded at time of parsing this line". Unfortunately, it looks like the appending happens before the parsing.
I like the compartmentalized aspect of .bbappend
but haven't found a way to refer to the .bbappend
itself or if there is some other way to get the git info from the original layer. Any thoughts?
You can demonstrate the immediate expansion with the following demo. Edit meta-yocto/recipes-core/busybox/busybox_%.bbappend which ships as part of the standard Yocto Project reference setup and add:
SOMEVAR := "${@bb.warn("${FILE}")}"
If you then run "bitbake -p" to reparse the metadata, it will show:
WARNING: /meta-yocto/recipes-core/busybox/busybox_%.bbappend
showing that it was run at the time the file was parsed. This is why you will sometimes see tricks like:
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:
which is also in that bbappend. This adds a directory in that layer into the search path for files, which can then override the main recipe from the layer.