I'm very new to Linux and very new to building/compiling my own kernel. For starters, I'm just trying to figure out how to change the version string of my kernel. For instance, when I do uname -a, it prints out "Linux localhost.localdomain 3.11.10-100.fc18.i686". I'd like to customize that, but I'm not sure what file to edit. I know it must be some file in my kernel directory, but I've been going through them with no luck. Any help would be great!
Asked
Active
Viewed 3.4k times
1 Answers
25
At the top of the top-level Makefile, there are four lines
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 7
EXTRAVERSION =
The values are different for different kernel versions, of course. These are used to construct the version string, so changing them before building the kernel changes the version string of the kernel you build.
Additionally, there's a configuration option CONFIG_LOCALVERSION
, to be found under General Setup -> Local version - append to kernel release
in make menuconfig
that is appended to this.

Wintermute
- 42,983
- 5
- 77
- 80
-
Alright I found that file. For some reason though, what uname -a shows is different than what the makefile shows. Also, is EXTRAVERSION what I would want appended onto the end ? – pfinferno Feb 23 '15 at 22:50
-
1The Fedora guys compiled their kernel with `EXTRAVERSION` set to `100.fc18.i686`. Changing the makefile in a kernel source tree will not affect the version string of the running kernel, it will affect the version string of the kernel you build from those sources. – Wintermute Feb 23 '15 at 22:52
-
1Or they might have used `CONFIG_LOCALVERSION`, to be found in `make menuconfig` under General Setup -> Local version. – Wintermute Feb 23 '15 at 23:01
-
alright I see. Yeah I didn't build the custom kernel yet, I figured if I was in the source tree and did uname -a it would base it off of that. I just changed the EXTRAVERSION in the kernel source tree. Compiling it now, will update when it's finished. Thanks! – pfinferno Feb 23 '15 at 23:04
-
1Alright, it compiled but yet the name still returns the running kernel, not the one I'm building. Why is that? – pfinferno Feb 24 '15 at 01:26