Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

For each Linux kernel version, there is a patch file available for download. For instance, linux-3.12.22 has a corresponding patch-3.12.22.

What is the purpose of that patch? To always patch the corresponding kernel before compiling it, or to bring a former kernel version up-to-date with the kernel that the patch matches (3.12.22, in this case)?

share|improve this question

2 Answers 2

up vote 29 down vote accepted

The purpose is to save lots of traffic.

The Linux tarball is around 75MB, whereas the patches usually just have a few KB.

So if you compile your own kernel, and update to each new minor version the day it is released, instead of redownloading a new 75MB tarball for each minor update, you just download (for example) the main tarball for a given version once and then the patch for the version you actually want. When there is an update you re-use the already downloaded main tarball.

linux-3.14.tar.xz + patch-3.14.{1..n}.xz is below 100MB in total.

linux-3.14.tar.xz + linux-3.14.{1..n}.tar.xz is several times 100MB.

There is no downside to patching, the final result is identical, unless you do something wrong.

share|improve this answer
7  
As written, this doesn't quite answer the question. To be explicit, the purpose of the patch is that applying it to version n-1 of the source "upgrades" it to version n. The advantage is that it saves a lot of traffic, as the answer describes. –  David Richerby Jun 22 at 17:39
1  
I'm not a native speaker. But advantage sounds too weak to me somehow. Saving bandwidth/traffic is important for any server. It has purpose. –  frostschutz Jun 23 at 7:27
    
The part you didn't answer explicitly is, "To always patch the corresponding kernel before compiling it, or to bring a former kernel version up-to-date with the kernel that the patch matches (3.12.22, in this case)?" patch-3.12.22 is to upgrade from version 3.12.21 to .22, not to be applied to the 3.12.22 sources before compiling them. –  David Richerby Jun 23 at 8:15
    
Patches are usually for .0, e.g. VERSION = 3 PATCHLEVEL = 12 -SUBLEVEL = 0 +SUBLEVEL = 22. It would be annoying to go through 20 patches... –  frostschutz Jun 23 at 10:21
    
How would such traffic saving scheme be better than e.g. having a git clone of the repository and doing git pull when a new version gets released? –  Ruslan Jun 23 at 11:09

These are called "patchset". Patchset are groups of patches that serves the same functionality, are related, or implement a function in steps. These in particular, are the difference between a major revision of the kernel (X.Y) and subsequent minor/maintenance revisions (X.Y.Z) with several proposes:

  • Save space on the servers.
  • Save bandwidth.
  • Being easily applicable and distributable

Remember that those patchsets are incremental. You first have to apply patch .1 before patch .2, and after that you can apply .3.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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