On Ubuntu, the string returned by uname -r
is always of the form x.y.0-z-generic
(i.e., 3.19.0-21-generic
). Compiling Ubuntu's kernel ends up with a string that is of the form x.y.z
(i.e., 3.19.8
), the actual version of the kernel that is used. What does the z
represent in the first case? Is that the EXTRAVERSION parameter or is it something else? How do I get the version string of my build of Ubuntu to match the official one?
It is the ABI number. The following link should help answer your question:
https://wiki.ubuntu.com/KernelTeam/KernelMaintenance
From the Kernel/FAQ:
What differentiates the Ubuntu Kernel from the upstream Linux Kernel?
Ubuntu kernels are rebased against stable releases only through the development cycle, with many patches on top of the stable tag. Once the final release is made the master branch is never rebased again. While stable updates (post release) are usually applied, we sometimes make patch decisions that are counter to the stable releases.
So, the best one could say is that Ubuntu kernels are only loosely based on upstream stable. You'd have to examine the changelog to know exactly what goes into a particular kernel.
With every Ubuntu kernel release, we attempt to remain as true to the upstream Linux kernel as possible. However, there are inevitable patches which we carry on top of the upstream Linux kernel which differentiates the Ubuntu kernel from the upstream Linux kernel. This document attempts to describe the general set of patches which are carried and why: Kernel/FAQ/UbuntuDelta
What does a specific Ubuntu kernel version number mean?
The official version of an Ubuntu kernel tells you a number of things, including the base upstream version, the current Ubuntu ABI identifier and the kernel flavour. (See How can we determine the version of the running kernel? to find your current version number.)
Given a version like 2.6.35-6.9-generic this can be broken into four parts as below:
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 (See What is a Kernel Flavour?).
How can we determine the version of the running kernel?
The official version of an Ubuntu kernel is found in the /proc/version_signature file. This file contains both the full Ubuntu version of the kernel and the mainline version on which it is based. The first field is always Ubuntu, the second field is the Ubuntu kernel version, and the final field is the upstream version: