在 Yocto 中,我如何选择将我的补丁应用于多个源中的哪个源?

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

我有一个方法将两个存储库 A 拉入 ${S} 并将 B 拉入 ${Sprime}。我想要一个本地补丁文件应用到 ${Sprime} 中的源代码。我怎样才能做到这一点?我不断收到 can't find file to patch 错误。 Yocto 是否仅将补丁应用于主源存储库?

您可以通过以下方式将 patchdir 作为参数传递给 SRC_URI 中的补丁:

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