I have two repositories, A and B, which have a common ancestor. A then has a branch with a specific patch (let's call it C) and I would like to apply this patch to B. I believe it is important to notice that this patch has been applied through several commits, on top of the mainline kernel, since it is an ongoing project on the mainline kernel.
My initial plan was to:
- Clone C and B into two local repositories.
- Merge B and C, resolving conflicts.
- Create a Yocto Layer based on this patch.
The goal is to have a layer that, when put on a recipe on B, applies the patch on B. I am not sure about my first two steps (or if there is any better way of doing this), and my last step seems yet very confusing to me, specifically on how would it be done in practical terms. For now, I have no interest in the branches' history.
To be more specific (I don't know if this helps): Branch C is a mainline Linux kernel with a specific patch. Branch B is a different kernel, although it is the same version as in C (5.4). I want to apply the patch from C in B.
What is the best (if any such thing exists) approach to achieve this?