Linux-kernel

Any donation is very welcome
Fork me on GitHub

I. Linux kernel articles

8. Send patch to Linux

You made a patch to add a new feature or to solve an issue ? Nice ! But it'd be better to send it to the Linux foundation now ! I'll explain you how in this chapter.

Setup

First, we need to add the missing tools:

> apt-get update
> apt-get install git git-email gitk

Then you'll need to configure your git if you haven't done it yet:

git config --add user.name "Guillaume Gomez"
git config --add user.email "guillaume1.gomez@gmail.com"

Once this done, we need to add the configuration for git-email. Add the following lines to your ~/.gitconfig file:

[sendemail]
    smtpencryption = tls
    stmpserver = smtp.gmail.com
    smtpuser = guillaume1.gomez@gmail.com
    smtpserverport = 587
    from = Guillaume Gomez <guillaume1.gomez@gmail.com>
    suppresscc = self

Of course, change the information to make them match your own configuration. Please note that some smtp servers might not accept very well git-email so you'll need to do some additional change. For example, on gmail, I had to go to my account and set "Authorize less secured applications" parameter to true.

Once you have done this, we can continue !

Commit messages

The commit messages have to be very explicit to make the work of linux developers easier. For example, if you worked on tty and solved an issue, your commit message should look like:

tty: solved [description of issue]

Creating the patch file

Once you have commited your changes, you'll need to create the patch file to send. It's very easy to do:

> git format-patch -s -n master..fix_branch

Where fix_branch is the branch where you made the changes (never modify master directly!). You should now have a file called 000x-something.patch.

Checking patch

Before sending the patch, it would be nice to check if there is any error in it, right? A script does it for you:

> scripts/checkpatch.pl 000x-something.patch

The output should look like this:

total: 0 errors, 0 warnings, 14 lines checked
000x-something.patch has no obvious style problems and is ready for submission.

If you have warnings, it's *generally* OK, but please check if there is nothing serious before going forward.

Know whom you should send the patch to

You can't just send your patch to anyone! Once again, a script is provided to get the concerned people list:

> scripts/get_maintainer.pl 000x-something.patch

And so you should get something like this:

Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:TTY LAYER)
Jiri Slaby <jslaby@suse.com> (supporter:TTY LAYER)
linux-kernel@vger.kernel.org (open list)

Sending email

Before going any further, please test your patch!

Done?

Good! Before sending the mail, it would be nice to test if everything is working fine, right? Let's send an email to ourselves!

> git send-email --to "you@you.com" 000x-something.patch

If you have some issue with Perl, please install the missing libraries/packages through a Perl package manager.

If you received the mail, congrats! It means you're now ready to send it to the Linux foundation:

> git send-email --cc "you@you.com" --cc "linux-kernel@vger.kernel.org" --to "gregkh@linuxfoundation.org" --to "jslaby@suse.com" 000x-something.patch

Once this done, you can follow your patch status on mailing list. There are a few websites where you can see them. I usually go on marc.info, but there is also Linux Kernel Mailing Lists and others... I'll let you check. Hope it helped!