How to Change Version String of the Kernel

How to change version string of the kernel?

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.

Changing Version String in Linux Kernel sources

It's in the first four lines of the top level Makefile.

buildroot - how to change kernel version string

You have a .config? Look in there for the value assigned to CONFIG_LOCALVERSION.

To have no local version specifed in the kernel's release, either remove CONFIG_LOCALVERSION or comment it out by starting the line containing it by a #.

The default shall be:

#CONFIG_LOCALVERSION is not set

Kernel panic after changing version string

You made init segfault by breaking the kernel / user ABI for the uname(2) system call (by changing the struct size/layout).

Its exit code of 0xb is 11, which is the signal number for SIGSEGV. Attempted to kill init! was the cause of the panic, not a symptom or side-effect.

As @RossRidge said in a comment:

The 1024 number for _UTSNAME_LENGTH is only used for the stub implementation of uname for systems that don't support this system call. You'll need to rebuild glibc using your modified Linux kernel headers and then rebuild the init you're using with this custom version of glibc.

Dmitry confirms that changing _UTSNAME_LENGTH from 65 to 129 in

glibc-2.11.3/sysdeps/unix/sysv/linux/bits/utsname.h
solved the problem, after rebuilding the root fs.

A less-hacky general solution is to really rebuild glibc against the updated kernel headers.

Changing LineageOS build kernel version string

Easiest way is to temporarily rename your PC and create a new user.



Related Topics



Leave a reply



Submit