I've never done a kernel patch before, and I've just recently started looking into how it's done. I notice that for a patch's filename, it tells us the kernel version (i.e dm-raid45-2.6.25-rc2_20080221.patch.bz2). So, I know that definitely for kernel 2.6.25, I'd need to apply this patch. But, I just want to make sure: If I've got a kernel that is more recent than the one mentioned - say, 2.6.26 - does this mean that this patch has already moved its way to the 2.6.26 kernel version and that I won't need to apply it at all?

Thanks for clarifying!

  • @Sanda: The short answer to your question at the end is - it depends. I'm not sure exactly what your question is. Do you want to know how to apply a kernel patch? Or something else? – Faheem Mitha Apr 29 '11 at 16:19
  • 1
    @Faheem: To be more specific, I am wondering if I would need to do a patch (i.e if the patch has "2.6.25" in the filename, does this mean that in a 2.6.26 kernel, this patch wouldn't need to be applied?) – Sandra E Apr 29 '11 at 17:11

First of all, you shouldn't need to patch your kernel just because it's not the latest. You would normally rely on your distribution maintainers to do patching. You might need to patch if you had some kind of uncommon hardware, but most of the time, you just need a different or newer kernel module that is supplied separately from the kernel. My current touchpad has issues with the stock Ubuntu Kernel, but I installed a Package someone built to fix it instead of patching my kernel. Some of the more common reasons to patch a kernel are to test out some new feature or update some more core functionality than a device driver.

Assuming you need or just want to patch your kernel, beware that most patches are against a vanilla kernel as one might download from kernel.org. Most Linux distributions have already applied a number of patches of their choosing against a vanilla kernel which can cause a patch to fail to apply. If you want to learn how to patch a kernel, I would first practice building a vanilla kernel and try to boot from it once before patching it.

To answer your last question, it all depends. I can't tell you whether it's in later kernels without knowing exactly what the patch is and looking at the changelog of 2.6.26. Many people provide patches against the kernel for various reasons. The patch may be a bug fix or maybe just an enhancement. Sometimes, it an experiment to improve disk I/O throughput, or some other experiment. There may or may not be an intention to get it integrated with the next kernel release. A patch does not mean that a bug needs to be fixed, or it may attempt to fix a minor bug, but causing a gaping hole instead and be rejected before ever being integrated.

  • 1
    Thanks, that was helpful. I actually didn't realize when I asked this question that patches are just results of diff (with some change), so this means that if I really needed to apply a patch for whatever reason, I'd need to get the patch that specifies my kernel version, right? – Sandra E Apr 29 '11 at 20:18
  • @SandraE: Not necessarily. For example, if you are patching parts of the kernel that haven't changed forever, the the patch will apply. Also, patching is smart enough that it would apply to newer, although it will tell you that stuff you are patching has changed since the patch was created. In other cases you'll get conflicts, which basically means that the change the patch introduces doesn't comply with a different change, and this happens when both changes modify the same line(s). – Tshepang May 1 '11 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.