如何修改Linux内核以更改uname返回的版本字符串? [英] How to modify the Linux kernel to change the version string that uname returns?

查看:1719
本文介绍了如何修改Linux内核以更改uname返回的版本字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用旧版本(2.6.33.2)的嵌入式Linux,并且已被要求更改内核,以便可以区分出不同补丁的内核映像.此刻,uname -v输出例如"#1 Wed Sep 11 07:07:51 BST 2013.

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.

因此,我想更改此设置,以便所有后续补丁将#1部分更改为定义为补丁一部分的修订版本号(并将日期部分更改为最新内核补丁的日期),但我看不到它在内核中的什么位置设置.

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.

我应该查看哪些文件?

推荐答案

尝试设置KBUILD_BUILD_TIMESTAMP.默认值为日期",因此可能类似于

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

export KBUILD_BUILD_TIMESTAMP="r3 `date`"

#1开头是.version文件,在每次配置/构建后都会递增.

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

有关更多信息,请参见文件scripts/mkcompile_h.

See file scripts/mkcompile_h for more info.

这篇关于如何修改Linux内核以更改uname返回的版本字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆