Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change kernel version string with Buildroot

Tags:

buildroot

Is there some way in Buildroot to change the kernel version string displayed with the "uname -a" command? For example:

# uname -a
Linux buildroot 5.1.0 #1 PREEMPT Wed Nov 6 13:10:04 MST 2019 armv5tejl GNU/Linux

I would like to append something so the version look like: "5.1.0-xxxx-xx".

I check this post but it doesn't make sense to me. Which .config file does it refer to? I see 4 in my Buildroot directory, the default one at the root and three more under "./output", which come from other repos.

Thanks, Dave.

like image 960
DaveR Avatar asked Sep 16 '25 00:09

DaveR


1 Answers

You need to set the LOCALVERSION configuration parameter of the Linux kernel (the kernel version string is a kernel feature, not a Buildroot feature).

  1. from Buildroot enter the Linux configuration interface: make linux-menuconfig
  2. Go in General setup and set Local version - append to kernel release to -foo-bar
  3. Exit menuconfig saving your changes
  4. Build the whole Buildroot image: make

Now uname -a will show: Linux buildroot 5.1.0-foo-bar #1 PREEMPT Wed Nov 6 13:10:04 MST 2019 armv5tejl GNU/Linux.

To know how to make these changes persistent, read "Storing the configuration of other components" in the Buildroot user manual.

like image 163
Luca Ceresoli Avatar answered Sep 18 '25 17:09

Luca Ceresoli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!