Search code examples
yoctopatch

In Yocto, how do I chose which of multiple sources my patch gets applied to?


I have a recipe pulling two repositories A going into ${S} and B going into ${Sprime}. I want a local patch file to apply to the source code in ${Sprime}. How can I accomplish this? I keep getting a can't find file to patch error. Does Yocto only apply patches to the main source repository?


Solution

  • You can pass patchdir as a parameter to your patch in SRC_URI the following way:

    SRC_URI += "file://my.patch;patchdir=path/relative/to/${S}"
    #or SRC_URI += "file://my.patch;patchdir=/absolute/path/to/${Sprime}"
    

    c.f. https://docs.yoctoproject.org/ref-manual/ref-variables.html#term-SRC_URI