Re: [yocto] Dynamically load patch series from fetched repositories.
Danill Klimuk <[email protected]>
| Newsgroups | org.yoctoproject.lists.yocto |
|---|---|
| Organization | 3mdeb |
| Message-ID | <[email protected]> |
On 1/5/26 12:35 PM, Ross Burton wrote: > 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 Thank you for all your suggestions. > 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. I have another use-case. The repository https://github.com/Dasharo/dasharo-pq contains or will contain not patches for itself, but will gather all patches from Dasharo organization for different upstreams (in this example it is flashrom) in one place, which will simplify upstreaming and maintaining the patches. -- Best regards, Daniil Klimuk. 3mdeb Zarhus Team Leader. https://3mdeb.com | @3mdeb_com