[yocto] Patch a package with condition

Ross Burton ross.burton at intel.com
Fri Sep 13 08:37:54 PDT 2019


On 13/09/2019 06:55, PRASANTH R wrote:
> I need to patch my custom recipe, let say "Package-A.bb" in which I need 
> to add a patch to the test recipe if the yocto build has a specific 
> package like let's say if "Package-B" is available patch should be 
> applied for Package-A.bb
> I am trying with below step in Package-A.bb
> SRC_URI_append_Package-B = " file://0001-add-new-line.patch"
> 
> But it doesn't work, I could see this SRC_URI_append_* works only for 
> some specific tokens like board name, Architecture, library or 
> native-class as such
> 
> Have u come across the scenario to make a dependency in patching with 
> reference to another package? which way I can use this?

You can't patch a recipe depending on whether another recipe is going to 
be built, because the process is that recipes produce packages, and 
packages built images.

So you're building two images, one of which contains Package-A and the 
other contains Package-A and Package-B.  Bitbake will only build those 
recipes once.

Ross


More information about the yocto mailing list