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 ofuname
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 inglibc-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
When and How Are System Calls Interrupted
How to Debug Mex Code with Eclipse
How to Delete Everything in a String After a Specific Character
How to Run Linux Docker Images on Windows Server 2016
What Is Chained Irq in Linux, When Are They Need to Used
Switch from 32Bit Mode to 64 Bit (Long Mode) on 64Bit Linux
How to Calculate the Total Size of Certain Files Only, Recursive, in Linux
Interrupting Epoll_Wait with a Non-Io Event, No Signals
How to Know Whether a Copy-On-Write Page Is an Actual Copy
Configure and Build Opencv to Custom Ffmpeg Install
"Current" in Linux Kernel Code
How to Force a Firefox Page Refresh from Linux Console
What Is Kernel Section Mismatch
Poll(2) Doesn't Empty the Event Queue
Put Every N Rows of Input into a New Column
Change Filenames to Lowercase in Ubuntu in All Subdirectories
What's the Difference B/W _Raw_Readl/_Raw_Writel and Readl/Writel in Linux Kernel