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.
Adding some extra info in uname -v output string in linux kernel
The variable CONFIG_LOCALVERSION (inside your kernel .config file) let you set a custom string that will be appended to the kernel release number, thus shown when using 'uname'.
Is that what you want?
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.
Linux kernel : Kernel version string appended with either ''+ or -dirty
If Linux kernel images are being built with "-dirty" on the end of the version string, this simply means that modifications in the source directory have not been committed. Use git status
to check for uncommitted files.
When you see the dirty string, it appends the kernel version string with the last abbreviated commit id + dirty
to the kernel version.
You can use the above Git command to report modified, removed, or added files. You should commit those changes to the tree regardless of whether they will be saved, exported, or used. Once you commit the changes, you need to rebuild the kernel.
To force a pickup and commit of all such pending changes, enter the following:
$ git add .
$ git commit -s -a -m "getting rid of -dirty"
Alternatively, use the make -j2 LOCALVERSION="-customstring"
to get the custom string
Related Topics
Total Number of Bytes Read/Written by a Linux Process and Its Children
When Compiling Programs to Run Inside a Vm, What Should March and Mtune Be Set To
How to Implement Highly Accurate Timers in Linux Userspace
Postgres Copy Command, Binary File
X11 Forwarding Through Google Colab
How to Run My Own Script at Every Bootup
Assign Output of a Shell Command to a Variable
Bash Ip If Then Else Statement
Change Directory Using Loop in Linux
Extract Unique Block of Lines from a File Using Shell Script
Function Return Values Within Bash If Statements
Deleting All Files Except Ones Mentioned in Config File
Qwidget/X11: Prevent Window from Beeing Activated/Focussed by Mouse Clicks
Bash: Find and Replace Using Parameter Expansion
Create and Test X86-64 Elf Executable Shellcode on a Linux Machine