怎麼樣通過使用git來創建並提交你的第一個linux內核patch

原文地址:http://linux.koolsolutions.com/2011/02/26/howto-create-and-submit-your-first-linux-kernel-patch/

step 1:install git tools

apt-get update

apt-get install git git-email gitk

完成上面的安裝後,就可以進行一些簡單的配置:

git config --add user.name "jackyard"

git config --add user.email "[email protected]"

step 2:clone linus' git tree

這一步,就是通過git來下載linux內核,前提是必須保證你至少有2GB的空間。

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 mylinux-2.6

根據你的網速,下載時間可能要10幾分鐘。

Step 3: Now create a local branch to make your changes

git branch myfixdir
git checkout myfixdir

Step 4: Make your changes

在這裏你可以在當前目錄下修改你的代碼,在完成修改後,可以用下面的命令來保存:
git commit -a
這時會找開一個文本編輯窗口,要求你輸入log信息,這些log信息會成爲你patch的一部分,會和patch一起發給linux內核的維護者們。如下:

x86: Fix reboot problem on VersaLogic Menlow boards

VersaLogic Menlow based boards hang on reboot unless reboot=bios is used. Add quirk to reboot through the BIOS.

Tested on at least four boards.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch Test1
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   arch/x86/kernel/reboot.c
#

像上面藍色的信息會成爲主要的主題信息,通過它來區分不同的patch.在這一行後面,一定要留一個空行,如果沒有一個空行,它會和後面的description信息一起成爲你的subject line,這樣會顯的很亂。之後就是要輸入你的description信息,如上面桔黃色的部分。

以#號開問的log在提交時會忽略掉。

Step 5:generate your patch


 

Go on.............................

















引用:http://blog.csdn.net/paul_liao/article/details/7173772

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章