How to Write and Submit a Linux Kernel Patch

Orange Pi Development Boards

Greg Kroah-Hartman has a very good tutorial about writing and submitting a patch to the Linux kernel. The video is over 1 year old but this is still relevant.

The materials for this tutorial are available via git:

git clone git://github.com/gregkh/kernel-tutorial.git

Alternatively, you can also download a copy of the presentation slides.

The actual presentation is divided into 6 parts:

  • git basics (git branch, git clone…)
  • Kernel coding style (Details can be found in Documentation/CodingStyle)
  • Fixing a file (with scripts/checkpatch.pl scripts)
  • Generating a patch (with git -diff)
  • Email the patch (with scripts/get_maintainer.pl and git send-email)
  • Q&A

If you want to skip the git basics and kernel coding style parts (although I don’t recommend it), fast forward to 13:33.

All patches by in the linux kernel are checked by at least 2 persons. Before submitting a patch, you’ll have to make sure of the following (Checklist):

  • Kernel builds with patch applied
  • Correct “From:” address
  • Concise “Subject:”
  • Explain the patch
  • Signed-of- by

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Linux Kernel Upstreaming How-To – Linaro Connect Asia 2014Linaro Connect HK Greg Kroah-Hartman Keynote: “I Don’t Want Your Code!” Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
trackback

[…] If you want to learn in details what you have to do to submit a patch, you may want to read “How to Write and Submit a Linux Kernel Patch” presentation at FOSDEM […]

trackback

[…] already written a post about submitting kernel patches to mainline based on a 2011 presentation by¬†Greg Kroah-Hartman, but Matt Porter,¬†Broadcom Landing […]