Need clarification regarding when to use bb/inc file in Yocto
12:13 31 Aug 2023

I am new to Yocto, and still getting familiar with it.

I have a clarification on when to create inc or bb file for a package. So let's say I have a package A and my project already have a recipe bb file for it let say A.bb. Now if I am adding a new dependency to A for a different project B, then what I am unsure about is should I create an inc file for project B let's say B.inc and then include it in A.bb like this require B.inc or should I create a bb file for project B instead let's say B.bb and then add inherit B in A.bb.

Another clarification I have is that if I understand correctly your package can override/append stuff to bb recipe like X.bb by creating bbappend file like X.bbappend, but is it true for can inc file as well and if what file does your package create etc.

I also need to ask how to apply patches in .inc file for example if I need to apply a patch in A.bb what I have found is that if the code recipe looks like this

SRC_URI = "git://foopackage;protocol=ssh;branch=mainline;/
           file://foo.patch \
           " 

All I need to do is add a foo.patch in a subfolder foo and it will be applied, is that true for inc file as well i.e if I have B.inc file and it is something like this

SRC_URI = "git://barpackage;protocol=ssh;branch=mainline;/
           file://bar.patch \
           "

Does it mean that I need to create a subfolder bar in the folder that B.inc is for the patch to apply?

yocto yocto-recipe