Linux Kernel Versioning: Debian Sid vs Ubuntu Precise

I have setup two machines:

On one machine I have installed Ubuntu Precise 12.04 beta and dist-upgraded to the latest packages.

On the other machine I have installed Debian Sid Unstable and dist-upgraded to the latest packages.

On the Ubuntu machine uname -a reads:

Linux 3.2.0-20-generic #32-Ubuntu SMP Thu Mar 22 02:22:46 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

On the Debian machine uname -a reads:

Linux 3.2.0-2-amd64 #1 SMP Wed Mar 28 13:28:04 UTC 2012 x86_64 GNU/Linux

My question is about the kernel versions:

Ubuntu: 3.2.0-20-generic
Debian: 3.2.0-2-amd64

Version 3.2 of Linux was released on:

linux-3.2.tar.gz         05-Jan-2012 00:40   94M

Since then there have been 13 point releases, 3.2.1 .. 3.2.13 from kernel.org, and 3.3 released.

My question is about the history of the source tree of the two kernels on my two machines:

From which release of official kernel.org kernel are those two versions of the kernel derived?

What is the relationship of the sources of the Debian Sid kernel to the Ubuntu Precise one?

Are the changes made from the kernel.org sources to produce 3.2.0-2-amd64 also present in 3.2.0-20-generic on Ubuntu?

Is the Debian Sid kernel "upstream" of the Ubuntu one?

What does the fourth version number mean (after the first dash) "2" in the case of Debian and "20" in the case of Ubuntu - and how does it relate to the above?


Solution 1:

The Ubuntu kernel is not the same as the upstream kernel, although the version numbers may be similiar. You can read about the Ubuntu Kernel in the Ubuntu Wiki which answers your first and your fourth question:

Beta-2 includes the 3.2.0-20.33 Ubuntu kernel which is based on the v3.2.12 upstream stable Linux kernel.

The Ubuntu Kernel FAQ describes the version numbering as follows:

Given a version like 2.6.35-6.9-generic this can be broken into four parts as below:

<base kernel version>-<ABI number>.<upload number>-<flavour> The base kernel version represents the mainline version on which the Ubuntu kernel is based. The ABI number represents significant changes in the kernel Application Binary Interface. The upload number is a monotonically increasing counter for each upload of this base version. The flavour indicates which kernel configuration variant this is

You can also check the Ubuntu to Mainline kernel version mapping for more information on ubuntu kernel versions vs upstream kernel versions.

Solution 2:

Your Questions

From which release of official kernel.org kernel are those two versions of the kernel derived?
Kernel version 3.2.0.

What is the relationship of the sources of the Debian Sid kernel to the Ubuntu Precise one?
They are both Debian versions (no Ubuntu changes), the Debian package (3.2.0-2) is revision 2, the Ubuntu package (3.2.0-20) is revision 20.

Are the changes made from the kernel.org sources to produce 3.2.0-2-amd64 also present in 3.2.0-20-generic on Ubuntu?
I am unsure as they are (afaik) different packages (generic vs amd64 specific).

Is the Debian Sid kernel "upstream" of the Ubuntu one?
Yes. Debian is upstream of Ubuntu. Changes made by Ubuntu (signified by revisions ending -ubuntuX where X is a revision) are normally merged back into Debian

Revisions Numbers

tl;dr version: The number after the hypen is the revision number given by the package maintainer after new builds/patches.

--

For Debian, the number after the hyphen is the Debian Revision Number [source]
For Ubuntu, the number after the hypen is the Debian Revision Number and the number after the -ubuntu (if it exists) is the Ubuntu Revision Number [source-2]

Generally the number after the hyphen is the revision that the package maintainer gives.

Packages from package maintainers often have patches of various kinds applied to them (such as to fix incompatibilities; security fixes; minor improvements; different build flags etc.); this is why in your example kernel version 3.2.0 has multiple revisions.

Just because one is higher than the other does not necessarily mean it is newer, better or has all the same patches applied. This is because they may be different package maintainer(s) who are looking after the package on each distro and they may (for example) patch less frequently (meaning a lower revision number) but still incorporate [some or] all of the same patches.

Note: Ubuntu is based from Debian so more often than not Ubuntu has all the patches from Debian (and often from a newer debian release such as testing)

Package Relationships

A piece of software is made (e.g. kernel). This has a version (3.2.0). A package maintainer (Dave) for a distro (Debian). He takes the software and packages it up in a format (.deb) according to the guidelines of the distro. This is version 3.2.0-1 of kernel, aka kernel-3.2.0-1.

Dave hasn't quite followed the guidelines for the distro he is packaging for (Debian) and so has to make some changes to the package. He does this and submits his updated version. This is version 3.2.0-2 of kernel, aka kernel-3.2.0-2.

In the mean time kernel 3.2.1, 3.2.2 all the way to 3.2.25 have been released. The package Dave is working on is still based on 3.2.0. He will get round to releasing 3.2.25 soon but not yet.

At the same time, another package maintainer (Harry) needs the same package for his distro (Ubuntu). Since Debian and Ubuntu are similar; instead of doing everything from scratch, he just takes a copy of Dave's kernel 3.2.0-2 and submits it. Harry releases this to Ubuntu as 3.2.0-2.

Harry then wants to make some changes to Dave's work. He makes the changes and releases his updated package. This is version 3.2.0-2-ubuntu1

In this example:
Latest version of kernel is 3.2.25
Latest version of kernel package for Debian is 3.2.0-2
Latest version of kernel package for Ubuntu is 3.2.0-2-ubuntu1