Git/Linux: What is a good strategy for maintaining a Linux kernel with patches from multiple Git repositories? -


I maintain a custom Linux kernel that consists of changes that are merged from different sources. This is for an embedded system.

The Chip Seller is working with us to release a board support package as a change against a mainline kernel (2.6.31). I have made changes to support my custom hardware since then, and have merged with the stable (2.6.31.K) kernel release. I have also merged into a bug fix for a particular file system driver, which we sometimes use, before they make the changes in the mainline kernel.

I am not very systematic how I was chosen to merge the various contribution sources and if I had a big change in my own changes; If it was small then I would raise the third party's changes again on my own. Generally merge conflicts are very rare, because most of my work affects those drivers which are not in the Mainline kernel.

I am thinking that there is a better way to manage this. One concern is that my changes are mixed with the merger

2.6.31 + board support package + my changes (1) + 2.6.31.12 changes + my changes (2) + file system driver updates + My change (3) + 2.6.31.14 change + my changes (4) + ....

It makes me worry that my changes are mixed, sometimes on the other side of the merger . Is there a better way to do this? In particular, is there a way to do that when I change a new kernel will make life easier.

I do not think it will be easy to clean up your existing set up, unless your history is very short, but I would suggest it:

Set up a master repository, Set up

Place a separate branch specifically for updates from your driver supplier.

When you bring, updates will not mess with your branches.

When you are ready to merge, merge any kind of "release" branch. The idea is to keep each source separate from the other, except that it needs to be merged. Change your changes in this branch to the basics, merge / rebing as necessary.

Here is a quick diagram that I hope helper:

  main line - \ ---------- \ ------- ----------------- ------- \ \ / --- --- --- --- \ --- \ --- \ - / ---- / - / ------- - \ - / / - - - - - Patch ----------------- / - - / / / / / driver --------- ---------------- / -------------- /   

With so many branches, it is difficult to do the diagram effectively, but I hope you find out what I mean. Release puts the official code for your system, you keeps your own modifications, driver keeps patches from the driver supplier, Patch keeps track from some other repo, and mainline is the mainline kernel. Everything gets dissolved in Releases , and you close your changes to release but interact only by merger in each direction, directly release .

Comments