I have two recipes that build an embedded linux image, call them A.bb
and B.bb
. I have a kernel patch that needs to be applied to one recipe but not the other. Following these docs I created my own layer and added a bbappend <your-layer>/recipes-kernel/linux/linux-yocto_3.4.bbappend
and inside I put SRC_URI|+="kernel.patch"
. How can I do something like the following:
if (A):
SRC_URI+="kernel.patch"
else:
SRC_URI+=""
Inside A.bb
, I have export IMAGE_NAME="A"
Then inside linux_yocto_3.4.bbappend
I have
SRC_URI_append = " ${@bb.utils.contains('IMAGE_NAME', 'A', 'file://kernel.patch', '', d)} "
But this doesn't work. Thank you for your help!
You can't.
A recipe can't influence how anything else is built; an image is just a recipe, thus is can't modify how the kernel is being built nor patched.