Xalanz's 网络日志(Ethan's blog)

阳光风雨中的泥土Mud under the sunlight and rain

Just a piece of cake, N steps to create Linux kernel patch with git

step 1. init the local repository
#git init
step 2. configure user name and user mail address
#git config --add user.name "ethaxx.xxhao"
#git config --add user.email "ethaxx.xxrnel@gmail.com"
if you wanna set global configuration, issue command as following:
#git config --global user.name "ethaxx.xxhao"
#git config --global user.email "ethaxx.xxrnel@gmail.com"
view current git configuration
#git config -l

step 3. configure the proxy if needed
#git config --add http.proxy "proxy.company.com:1080"
#export http_proxy "proxy.company.com:1080"
step 4. clone the sour code tree from git.kernel.org
#git clone http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

step 5. view tags
#git tag
v3.1-rc8
v3.1-rc9
v3.1.1
v3.1.2
v3.1.3
v3.1.4
v3.2-rc1

step 6. checkout source code for v3.1.4
#git checkout v3.1.4

step 7. create your own branch
#git branch myv3.1.4


Combination of 6&7
#git checkout -b myv3.1.4 v2.6.14

step 8. make your own modification to files
#vi Makefile

step 9. commit your modification
#git commit -a

step 10. show your patch /without sign-off
#git show

step 11. create the patches as a batch with sign-off mark
#git format-patch -o /tmp/ --signoff master..myv3.1.4

Then you could find the patches under the directory /tmp ,the content as following:

From c1834f9ed202b0d3d885d15165dd1f00581dcff6 Mon Sep 17 00:00:00 2001
From: ethaxx.xxhao <ethax.xrnel@gmail.com>
Date: Tue, 6 Dec 2011 04:22:01 -0500
Subject: [PATCH] Just a test patch modified: Makefile
reversion to -rc8

Signed-off-by: ethaxx.xxhao <ethax.xrnel@gmail.com>
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 6a5bdad..1b84eae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 0
-EXTRAVERSION =
+EXTRAVERSION = -rc8
NAME = Sneaky Weasel

# *DOCUMENTATION*
--
1.7.1
"/tmp/0001-modified-Makefile.patch" 28L, 574C

不同的手机满足不用的欲望,2天G3 Hero换用Iphone 2A 2560 cores monster behind a Linux kernel macro

Write a comment

New comments have been disabled for this post.