Reputation: 1435
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.
Upvotes: 4
Views: 5259
Reputation: 1435
Arnout was kind enough to give me steps and pointers to the information I needed to figure this out but for completeness, I'll list all the steps I did to make this happen. I used Buildroots "make xconfig" to set the BR_* variables:
Set BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
As recommended in Recommended Directory Structure,I created a <BR_ROOT>/board/<company>/<board-name> directory and created an empty linux.config file in that directory.
Set BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE equal to the path in Step 2 i.e BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=board/<company>/<board-name>/linux.config
Executed the command "make linux-update-defconfig" to store my Linux configuration in the file I created in Step 3.
Followed the steps Arnout listed in his response to my original question.
Rebuilt my kernel and rootfs with "make".
Once I verified that everything was correct, I saved my new configuration with "make savedefconfig".
Upvotes: 0
Reputation: 1661
You need to set the LOCALVERSION
configuration parameter of the Linux kernel (the kernel version string is a kernel feature, not a Buildroot feature).
make linux-menuconfig
General setup
and set Local version - append to kernel release
to -foo-bar
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.
Upvotes: 4