Submitting A Patch To The Linux Kernel

A few weeks ago I sent a spelling fix to the Linux kernel, mainly just to try out the patch submission workflow but also because I get mildly annoyed by spelling errors until I have the overwhelming urge to just send a patch. Here’s the cliffnotes of the process.

  1. Do your edits in the kernel tree of your choice. Before commiting anything, check out how the maintainers write commit messages with git log.
  2. When it comes to commiting the changes, you need to add the -s at the end to do the signoff.
    # git commit <files> -s
  3. Generate the (single) patch using:
    # git format-patch HEAD~
  4. Check the patch for things that could make us get yelled at on the list:
    # ./scripts/checkpatch.pl <patch filename>
  5. Find out who exactly you need to send the patch to with the ✨magic✨ get_maintainer.pl script:
    # ./scripts/get_maintainer.pl <patch filename>
  6. Fire off the email and hopefully it all goes well:
    # git send-email <patch filename>

And that’s it! My last patch submission was over 10 years ago, and for some reason I remember this was a lot harder to do back then.

Leave a Reply

Your email address will not be published. Required fields are marked *