Linux Kernel Development Process

advertisement
Linux Kernel Development
Process
If you have any question about this document please contact Abraham Arce
abraham.arce.moreno@intel.com
Table of Contents
1
A guide to the Linux Kernel development process ............................................................................... 0
2
How the process development works .................................................................................................. 1
3
Early stage planning .............................................................................................................................. 3
4
Getting the code right ........................................................................................................................... 3
5
Posting patches ..................................................................................................................................... 3
6
Followthrough ....................................................................................................................................... 4
7
Advanced Topics ................................................................................................................................... 4
8
Conclusion ............................................................................................................................................. 4
1 A guide to the Linux Kernel development process
Let’s get started


Ask Wikipedia about Free Software
http://en.wikipedia.org/wiki/Free_software
Ask Wikipedia about Linux Kernel
http://en.wikipedia.org/wiki/Linux_Kernel
$ git ls-files
$ git ls-files | wc -l
$ git log --pretty=oneline
$ git log --pretty=oneline | wc -l
What Linux Kernel development process is about?

View “How Linux is built” by LinuxFoundation @ Youtube
http://www.youtube.com/watch?v=yVpbFMhOAwE
$ find . -type f -name \*.[ch]* -print0 | xargs -0 cat | wc -l
$ git log --pretty=short | grep Author
$ ls arch
$ ls arch/ | wc -l
$ ls arch/x86 |
$ ls arch/arm
$ ls arch/x86/configs
$ ls arch/arm/configs
$ git log | grep scalable
$ git log | grep capable
$ git log | grep reliable
The importance of “getting” code into the mainline




Go to mainline, the main repository of the Linux Kernel source code and get used to the
interface, find out about the different sections
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git
Read how changes can influence the direction of the Linux Kernel
http://marc.info/?l=linux-kernel&m=128979084506774
Read how delayed code changes make kernel developers angry
https://lkml.org/lkml/2010/11/2/147
Read how unprepared code submissions make Linus Torvalds mad
http://thread.gmane.org/gmane.linux.kernel/1114495/focus=112007
$ vi README
$ git log
/propietary
$ git log c752d04
$ git ls-files arcslh/arm | grep gpio
$ git ls-files arch/arm | grep gpio | wc -l
$ git ls-files arch/powerpc | grep gpio
$ git ls-files arch/powerpc | grep gpio | wc -l
Licensing
Linux Kernel Development Process
Page 1 of 4

Ask Wikipedia about GNU General Public License
http://en.wikipedia.org/wiki/Gpl
$ git grep GPLv2
$ vi COPYING
$ git log | grep signed-off
2 How the process development works
The big picture







Go to mainline, the main repository of the Linux Kernel source code
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git
Review section “tags”
What is the latest version of the Linux Kernel?
How many Release Candidates the Kernel has had in the last 2 cycles?
Find out more about the Merge Window cycle
https://lkml.org/lkml/2011/5/23/358
https://lkml.org/lkml/2012/5/21/296
https://lkml.org/lkml/2012/1/19/418
Find out more about some concerns on Merge Window cycle
http://kerneltrap.org/node/14152
Read Linus’ message celebrating the final release of a version
https://lkml.org/lkml/2012/3/18/132
$ git tag -l
The lifecycle of a patch
$ git checkout –b my.master origin/master
$ git tag -l
$ git checkout v3.6
$ git log
$ git format-patch -s -1
$ cat 0001-Linux-3.6.patch
checkout version 3.5 and generate top patch where version is changed
Mailing lists
$ git log | grep vger.kernel.org
$ vi MAINTAINERS
How patches get into the kernel
None
Linux Kernel Development Process
Page 2 of 4
$ git log | grep torvalds
$ git log | grep Torvalds | wc -l
Next trees
None
Staging trees
None
Tools
None
Getting started with Kernel development
None
3 Early stage planning
Early Stage Planning
None
Early Discussion
None
Who do you talk to?
$ scripts/get_maintainer.pl -f drivers/input/…
$ git log | grep Morton
When to post?
None
Getting official buy-in
None
4 Getting the code right
None
5 Posting patches
$ git format-patch -s -1 695dde
$ git config --global user.name "Abraham Arce"
$ git config --global user.email "xe1gyq@gmail.com"
$ nano drivers/input/joystick/a3d.c
$ git diff
$ git status
$ git add drivers/input/joystick/a3d.c
$ git status
$ git commit -a
$ git log
$ git format-patch -s -1
Linux Kernel Development Process
Page 3 of 4
$ scripts/checkpatch.pl <generated patch>
6 Followthrough

None
7 Advanced Topics

None
8 Conclusion

None
Linux Kernel Development Process
Page 4 of 4
Download