How to modify the Linux kernel to change the version string that uname returns?

随声附和 提交于 2019-12-08 02:41:53

问题


I'm working with an old (2.6.33.2) version of embedded Linux and have been asked to change the kernel so that differently patched kernel images can be told apart. At the moment, uname -v outputs e.g."#1 Wed Sep 11 07:07:51 BST 2013.

Hence I'd like to change this so that any subsequent patches change the #1 part to a revision number defined as part of the patch (and to change the date part to be the date of the latest kernel patch), but I can't see where in the kernel this is set up.

What file(s) should I be looking at to do this?


回答1:


Try to set KBUILD_BUILD_TIMESTAMP. Default is `date`, so it could be something like

export KBUILD_BUILD_TIMESTAMP="r3 `date`"

#1 at the beginning is from .version file, it's incremented after every configuration / build.

See file scripts/mkcompile_h for more info.



来源:https://stackoverflow.com/questions/19362262/how-to-modify-the-linux-kernel-to-change-the-version-string-that-uname-returns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!