Creating a Yocto layer from a merge between two repositories

Viewed 229

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:

  1. Clone C and B into two local repositories.
  2. Merge B and C, resolving conflicts.
  3. 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?

1 Answers

You can check out the single files (e.g. the patch) and store it locally (file protocol fetcher, SRC_URI="file://xyz.patch"), then apply it to the mainline kernel that you get via git (for a patch to work only path and filename have to be correct)

How to sparsely checkout only one single file from a git repository?

In this thread is another solution : Give each SRC_URI a name and use it it SRCREV overrides:

https://www.yoctoproject.org/pipermail/yocto/2015-July/025588.html

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

Related