如何自定义或删除引导时显示的其他Linux内核版本详细信息? [英] How to customize or remove extra Linux kernel version details shown at boot?
问题描述
对于此内核版本字符串(在启动时显示):
Linux版本3.12.18 (vagrant @ vagrant-ubuntu-trusty-64)(gcc版本4.8.2(Ubuntu 4.8.2-19ubuntu1))#1 SMP 5月1日星期四18:56 :23 UTC 2014
如何删除或自定义粗体部分作为内核构建的一部分?
通过设置以下定义,您可以自定义要编辑的部分版本字符串(在启动时或通过调用命令cat /proc/version
看到):>
-
KBUILD_BUILD_USER
更改您的无用"值. -
KBUILD_BUILD_HOST
更改您的"vagrant-ubuntu-trusty-64"值.
您可能还对KBUILD_BUILD_TIMESTAMP
(更改为"Thu May 1 18:56:23 UTC 2014")和KBUILD_BUILD_VERSION
(更改为#1")感兴趣.
完整的Linux进程标语位于 init/version.c .这些定义的值由脚本生成/mkcompile_h .您可以编辑这两个文件中的任何一个以完全控制您的版本字符串,但是您不知道何时可以使用这些附加信息.我建议仅更改定义.另一种选择是对主机系统进行一些更改,以覆盖生成的值.这样,您将添加其他构建维护,只是为了更改很少查询的值.
For this kernel version string (displayed on boot):
Linux version 3.12.18 (vagrant@vagrant-ubuntu-trusty-64) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #1 SMP Thu May 1 18:56:23 UTC 2014
How can the part in bold be removed or customized as part of the kernel build?
You can customize parts of your version string you wish to edit (seen at boot or by invoking the command cat /proc/version
) by setting the following defines:
KBUILD_BUILD_USER
to change your "vagrant" value.KBUILD_BUILD_HOST
to change your "vagrant-ubuntu-trusty-64" value.
You may also be interested in KBUILD_BUILD_TIMESTAMP
(changes "Thu May 1 18:56:23 UTC 2014") and KBUILD_BUILD_VERSION
(changes "#1").
The complete Linux process banner is finalized in init/version.c. The values of these defines are generated by scripts/mkcompile_h. You could edit either of these files to have full control of your version string, but you never know when this additional information might be helpful; I would recommend only altering the defines. Another option is to make some changes your host system to override generated values. By doing this, you're adding additional build maintenance just to change a rarely queried value.
这篇关于如何自定义或删除引导时显示的其他Linux内核版本详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!