So, I've submitted my first patch to the Linux Kernel! It's trivial set of documentation improvements - mostly done so I could see if I've got everything set up correctly.
This blog post is more of an aide memoire than a fool proof guide - I hope future me finds it useful!
I'll leave you to figure out how to install git on your system - one thing you will need to is run this command once you've finished setting it up.
git config --global format.signoff true
That will format the patches so they are acceptable to the kernel gods.
Nice and easy - will take a little bit of time as the kernel is quite large.
git clone -b staging-next git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
Then, of course, cd into the directory.
We need to create a branch to work on.
git branch mypatch
Then, let's switch to the new branch.
git checkout mypatch
Open up your favourite code editor, and make the changes 🙂
Double check that the changes are what we expect.
git commit -a
We want to create a patch for master from the spelling branch.
git format-patch master..mypatch
That will create a file called something like:
There are some scripts which will make sure everything is hunk-dory.
The patch has to be emailed to the maintainer of the code. Optionally, it can go to other people as well.
For a "trivial" patch - we can send it to the Linux Kernel Trivial Patch Monkey - trivial๑kernel.org.
Out should pop an email address!
If you haven't already, git needs to be able to send email.
sudo apt-get install git-email
[sendemail] from = YourName < email@example.com > smtpserver = smtp.gmail.com smtpuser = firstname.lastname@example.org smtpencryption = tls smtppass = PASSWORD chainreplyto = false smtpserverport = 587
Personally, I set an app specific password in the Gmail Security panel.
Ok, so let's send this puppy!
git send-email --to email@example.com --cc firstname.lastname@example.org 0001-Your-commit-message.patch
This will launch an interactive interface where you can double-check everything and, if you're happy, send the email.
Well, that's all it takes to send in a patch request.
Here's the video that I followed.