2

I got diff text from lkml how do I patch it into a kernel source? I am using debian

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
RN_
  • 143
  • 4
  • Short answer: you patch source code with the `patch` utility. But once you've done that, configuring and compiling the kernel correctly is a whole other question, and a pretty broad one at that. – Celada Jul 26 '14 at 02:15

1 Answers1

1

kernel.org has some excellent documentation on Applying Patches to the Linux Kernel.

Essentially, you use the patch command. Once you have acquired the patch (here called patchfile), place it in your build directory and then issue the command:

patch -p <num> < patchfile

where <num> is the number of leading slashes to remove from the filenames contained in the patch to be applied.

So, assuming your patchfile is in the top-level directory of your kernel source, you can apply it with:

patch -p1 -i patchfile

patch also has a helpful --dry-run option which will print out a list of what the command will do, without making any changes to your files: allowing you to fine tune any adjustments prior to committing them.

jasonwryan
  • 71,734
  • 34
  • 193
  • 226