【发布时间】:2013-10-20 11:09:50
【问题描述】:
我正在构建linux内核,如果我的内核在git下,那么每次的内核版本是:
Image Name: Linux-2.6.39+
如果我不使用 git,那么一切正常,最后没有任何加号。
我知道这是由 scripts/setlocalversion 脚本完成的:
if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
# full scm version string
res="$res$(scm_version)"
else
# append a plus sign if the repository is not in a clean
# annotated or signed tagged state (as git describe only
# looks at signed or annotated tags - git tag -a/-s) and
# LOCALVERSION= is not specified
if test "${LOCALVERSION+set}" != "set"; then
scm=$(scm_version --short)
res="$res${scm:++}"
fi
fi
那么,是否有可能无需更改代码来构建不需要在版本行末尾添加“+”的系统?
【问题讨论】:
-
设置
LOCALVERSION。你是在HEAD工作,还是有一个不干净的分支? -
您是否考虑过构建更新的内核。 2.6.39 真的很老了。当前版本是 3.11.4 并且有很多改进(但与 2.6.x 保持兼容)
-
找到了一个丑陋的解决方案 - 添加 LOCALVERSION= 来制作命令
-
附加的
+会给您带来什么困难?它有一个特定的含义,你所做的事情会导致任何在乎的人做出错误的决定。 -
“+”混淆了一些应用程序,例如“modprobe -l”在我的情况下查看 2.6.39 文件夹,没有加号。
标签: linux git linux-kernel