Linux Kernel 審 code 的流程

 GPL 專家 Armijn 介紹 Linux kernel team 給我們認識, 我才知道想把 code 放進 Linux kernel 不是一件容易的事. 這些也可以給一般的 programmer 參考.

他們第一件事就是要求 coding style. 然後是 check list. 相關的說明可以從 Linux 網站找到.

等到這些 code 變漂亮了 (the code is all great and shiny ) , 還要把 code 切成小塊. 因為太多 code 就很難 review. 另一方面, 切成小塊之後就可以分成不同的 patch.

– Fixing a bug
– Fixing a spelling mistake
– A bug fix for the same bug that appeared in several places over the
   kernel.
– A new driver.
– Support for a new SOC or evaluation board.
 
因為 Linux Kernel 是用 Git 維護 (和 SVN 相對), 只要中間爛掉一版, 後面就麻煩了. (If a version of kernel is broken the use of git bisect is made impossible or significantly harder.)
 
如果一個修改涉及整個 system 或是 SOC, 那麼也不用切小了. 此時可以從 kernel 的 MAINTAINERS 檔案找到對應窗口. 例如:
 
SQUASHFS FILE SYSTEM
M:      Phillip Lougher <phillip@lougher.demon.co.uk>
L:      squashfs-devel@lists.sourceforge.net (subscribers-only)
S:      Maintained
F:      Documentation/filesystems/squashfs.txt
F:      fs/squashfs/
 
L 和 M 裡面至少有一個是負責的窗口, M 是負責人, 而 L 是 mail list 的名單. 如果兩者都不存在, 預設窗口就是 linux-kernel@vger.kernel.org. 顯然 W 是網站 (web), S 是 status, F 是文件 (file), 第二個 F 是 folder, 這說明了這份 code 相關的資訊.
 
所以每當想要加一些 code 到 Linux kernel, 其實不需要別人牽線, 只好自己乖乖地按照應有的步驟把 code 準備好寄出就可以了.