How do I build a kernel using patches from LKML?

This patch series was sent to linux-input, so it’s available on Patchwork. To find it, you’ll need to remove the “Action Required” filter at the top of the screen; you’ll then find v2 of the patch (which matches your link), and also v3 of the patch which is the version that was merged. There’s a handy “Series” link in the top-right-hand corner: click on that, save the resulting file, then in your kernel tree,

git am /path/to/Logitech-G920-fixes.patch

will apply it for you.

On the current kernel tree, you will need to apply this patch first; so download that, and apply

git am /path/to/HID-Fix-assumption-that-devices-have-inputs.patch
git am /path/to/Logitech-G920-fixes.patch

To figure that out, I added the HID tree as a remote, then looked at the log for drivers/hid/hid-logitech-hidpp.c:

git remote add hid https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git
git fetch hid
git log HEAD..hid/for-next drivers/hid/hid-logitech-hidpp.c

If you’re going to work with Patchwork again in the future, it’s worth downloading pwclient and configuring ~/.pwclientrc:

[options]
default = linux-input

[linux-input]
url = https://patchwork.kernel.org/xmlrpc/

Then you can run pwclient git-am 11173117 and pwclient git-am 11197515 to apply the patch series directly.


There's a dedicated program for patching - patch. It's widely available across various OSs. Search for it in you repository, it should be there. Then consult your man patch.

  • A preview: https://linux.die.net/man/1/patch

  • Patch on Wikipedia