Re: [yocto] Dynamically load patch series from fetched repositories.

Ross Burton <[email protected]>
Newsgroups org.yoctoproject.lists.yocto
Message-ID <[email protected]>
On 29 Dec 2025, at 15:16, Danik via lists.yoctoproject.org <[email protected]> wrote:
> 
> Hi everyone. I am looking for a way to use patches in recipes without adding them to layers and then mentioning directly in SRC_URI. An example workflow would be:
> 
> 1. Fetch a repository that is added in SRC_URI, using either git or other available methods.
> 2. Check out the specific head in the repository  (a branch or a commit).
> 3. Let do_fetch or do_patch search for either a "series" file or a list of patches in the repository.
> 4. Apply the patches.
> 
> The only problem I see in the proposed flow is the 3rd step. Some repositories may contain patches that could be applied to different tools or packages. And a recipe that is responsible for a package A can try to apply patches for a package B that is being stored in the same repository with patches. Hence, the 3rd step should be restricted somehow. An example could be a variable that will point out the place in the repository with patches where the recipe for package A should search patches. The variable can utilize overrides to customize patch queues further.
> 
> An example of the repository with patches can be found here: https://github.com/Dasharo/dasharo-pq/tree/flashrom-testing/flashrom . The idea here is not to copy and paste the huge amount of patches into different build systems, but to have a single place where all patches are added and maintained. Other pros for this solution:

A repository that contains patches for itself is slightly unhinged (just make a new point release), but I do work with repositories that depend on and statically link to other projects so carry patches in-tree for them.

We’ve got a class that applies the in-tree patches in a task after do_patch: https://git.yoctoproject.org/meta-arm/tree/meta-arm/classes/apply_local_src_patches.bbclass.  It’s not ideal, but it works.

Ross
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.