[Question]: Can't checkout _exact_ kernel release

Maxim Blinov maxim.a.blinov at gmail.com
Thu Sep 17 23:08:39 UTC 2020

Hi everyone, apologies in advance for the noob question:

I want to build exactly the same kernel version as the one that ships
with my Ubuntu 16.04 release (yes I know it's quite old now), "Linux
4.4.0-186-generic". But everytime I checkout the git tag called
"Ubuntu-4.4.0-186.216", `make menuconfig` insists that I'm building
"4.4.228". Details below...

So first I git clone the Ubuntu kernel code, and I'm a bit confused -
there seem to be two git repos:

(Recommended by this answer:

(Recommended by official docs:

I ofcourse lean towards using official Ubuntu documentation, and use
the second link. But what is the difference between the two?

But my major problem, is that I can't seem to checkout _exactly_ the
same version as my running kernel: If I do `$uname -rs` on my
workstation, I get "Linux 4.4.0-186-generic"

So then I do `git tag` to find it in the repo, and I find this:

Ok, I check it out, and I copy the .config from
"/usr/src/linux-headers-4.4.0-186-generic/". Then I go into the kernel
directory, do `make menuconfig`, and I see:

".config - Linux/x86 4.4.228 Kernel Configuration"

at the very top of the ncurses menuconfig window. But I thought I
checked out 4.4.0-186?

If I then try to overwrite the .config file, the only change between
.config and .config.old is like this:

$ diff .config .config.old
< # Linux/x86 4.4.228 Kernel Configuration
> # Linux/x86_64 4.4.0-186-generic Kernel Configuration

which proves to me that indeed, the git tag name does not seem to
correspond with the Linux version. If someone could suggest the
correct procedure for this, it would be greatly appreciated.

(My motivation is for kernel hacking - I would like to be able to
evaluate my kernel changes on a desktop system in the context of an
official distribution.)

Best Regards,
Maxim Blinov

More information about the kernel-team mailing list