Size: 2783
Comment:
|
Size: 2686
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
What are the benefits of merging code upstream? | '''合併至上游程式碼有什麼好處?''' |
Line 5: | Line 5: |
Merging your source code upstream takes effort, dedication and time. The process is not easy, because the moment Linus accepts code into his tree, he runs the risk of having to maintain that code for the rest of his life. If bad quality code got accepted, maintaining the Linux kernel would become much more difficult. These reasons and more mean that the threshold for getting source code accepted into the Linux kernel is relatively high. | 合併你的原始碼至上游要花費精力,貢獻和時間. 過程並不容易, 因為Linus接受程式碼進入他的版本時, 他冒著這一輩子得維護該程式碼的風險. 如果品質差的程式碼被接受, 維護Linux核心會變得非常睏難. 這些理由還有更多意指讓程式碼收入Linux核心門坎相對的提高. |
Kernelnewbies網站的這個部份本意是如何讓程式碼併入上層核心的手冊, 由Linus Torvalds維護和可以從kernel.org取得的的核心樹.
合併至上游程式碼有什麼好處?
合併你的原始碼至上游要花費精力,貢獻和時間. 過程並不容易, 因為Linus接受程式碼進入他的版本時, 他冒著這一輩子得維護該程式碼的風險. 如果品質差的程式碼被接受, 維護Linux核心會變得非常睏難. 這些理由還有更多意指讓程式碼收入Linux核心門坎相對的提高.
However, there are also a number of benefits to having your source code accepted into the kernel.
Maintainability
Keeping up with the changes in the upstream kernel can be a challenge, wasting days or weeks of developer time every time the upstream kernel changes. Code that lives in the upstream kernel does not have this issue, since kernel developers tend to simply grep the sources and fix up any driver that is impacted by a proposed API change. This frees up your developers for more important work.
Ubiquity
Your source code will be present in every Linux distribution. This matters if you would like to sell your hardware to every Linux user. No more need to lobby distributions to include your patches (hard), you can just ask them to switch on a config option (easy).
Quality control
Some of the world's best developers will be going over your source code with a fine comb. This may be embarrassing for a few days or weeks, but in the end the code tends to work better and be more easily maintained. In some cases the upstream developers have made network and storage drivers 30% faster, making the hardware more attractive to customers.
How to merge code upstream
Merging code into the upstream kernel can be a daunting process to the uninitiated. However, with the right strategy in mind, you won't get lost on your way to upstream acceptance.
/MergingStrategy strategies for merging code upstream.
/WhatNotToDo what you should never do if you want to merge upstream.
/GettingFlamed Oh no! The kernel developers said bad things about me, my code and my cat! What do I do now?
Helpful documents from the kernel tree:
/SubmittingDrivers how to submit device drivers to the linux kernel.
/SubmittingPatches how to submit patches to the linux kernel.
/SubmitChecklist a checklist for submitting code upstream.
Other documents on getting patches upstream:
- The Perfect Patch
- The Linux Driver Project