linux 内核版本中自动加入 git 版本信息
来源:互联网 发布:js复合保温图集 编辑:程序博客网 时间:2024/06/05 12:05
在调试驱动时,需要在内核中打印一些信息,但是每次编译后,内核版本总是加上git的版本信息,这样驱动有需要重新编译,如果linux内核版本不变就好了。
在网上找了一些信息,是setlocalversion 在作怪。
make menuconfig
General Setup --->
Automatically append version information to the version 将这个去掉
重新编译,发现多了一个 + , 再看 setlocalversion 脚本
# If only the short version is requested, don't bother # running further git commands if $short; then echo "+" return fi # If we are past a tagged commit (like # "v2.6.30-rc5-302-g72357d5"), we pretty print it. if atag="`git describe 2>/dev/null`"; then echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' # If we don't have a tag at all we print -g{commitish}. else printf '%s%s' -g $head fi
这里的 short 为 1,就是在这里加入的 + 号。
干脆点,不让编译器执行这个文件得了。
在linux 的顶层Makefile中 把这一句:
$(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
改为:
$(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree))" > $@
0 0
- linux 内核版本中自动加入 git 版本信息
- linux内核版本信息说明
- linux查看内核、版本信息
- 认识Linux内核版本信息
- linux内核版本信息说明
- Linux内核版本信息获取
- 查看linux内核版本信息
- 查看linux内核信息及版本信息
- 查看linux版本信息和内核信息
- 查看linux内核版本信息的命令
- Linux编程获取系统信息内核版本
- 查看Linux内核和发行版本信息
- Qt程序加入版本信息
- FMDB 加入数据库版本信息
- 如何在*.CS文件中加入版本跟踪信息?
- 在*.cs文件中加入版本跟踪信息
- linux内核编译时,修改内核版本信息
- Android系统信息之Linux内核版本信息获取
- 使用ServletFileUpload实现上传
- 微积分(一)--方向场,积分曲线
- 【转载】CMD命令大全及详细解释和语法
- char * a, char ** a, char * a[], char a[][], char * a[][], char ** a[][], char * a [][][], and so on
- varnish pipe 和pass的区别分析
- linux 内核版本中自动加入 git 版本信息
- 数据结构和算法经典书籍
- jQuery 获取当前节点的html包含当前节点的方法 --$(".test").prop("outerHTML");
- 【暮色天】世界杯完美谢幕 金银重回震荡?(7.14)
- app-framework学习--pannel介绍
- Java技术对存储模型的要求
- 详解Java反射机制实例
- 【项目课题】Hibernate的一对一关系联合主键ID类不同而引起的错误
- 三个有名的ACM Online Judge