Linux内核:内核版本字符串,后接"+"号或“肮脏" [英] Linux kernel : Kernel version string appended with either ''+" or "-dirty"

查看:175
本文介绍了Linux内核:内核版本字符串,后接"+"号或“肮脏"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Linus Torvalds的git安装最新的内核,即版本3.16-rc7.我通过使用以下命令创建了一个新分支: git checkout -b v_3_16 v3.16-rc7 然后我在分支v_3_16上签出并触发以下命令 make menuconfig并检查选项CONFIG_LOCALVERSION_AUTO,因为我需要更新版本字符串. 但是我不明白为什么要在版本字符串后附加"+"或"-dirty"(禁用CONFIG_LOCALVERSION_AUTO时). 我已经使用git commit -a签出了未提交的更改,但没有任何提交.

I am trying to install latest kernel from git of Linus Torvalds, i.e., version 3.16-rc7. I have created a new branch by following using following commands: git checkout -b v_3_16 v3.16-rc7 Then I checkout on the branch v_3_16 and fire following commands make menuconfig and check the option CONFIG_LOCALVERSION_AUTO because I need the version string to be updated. But I cannot understand why does this append "+" or "-dirty" (when CONFIG_LOCALVERSION_AUTO is disabled) to the version string. I have checked out for uncommited changes using git commit -a but it says nothing to commit.

推荐答案

如果使用版本目录字符串末尾的"-dirty"构建Linux内核映像,则仅表示尚未提交对源目录的修改.使用git status检查未提交的文件.

If Linux kernel images are being built with "-dirty" on the end of the version string, this simply means that modifications in the source directory have not been committed. Use git status to check for uncommitted files.

当您看到脏字符串时,它会将内核版本字符串和最后一个abbreviated commit id + dirty附加到内核版本中.

When you see the dirty string, it appends the kernel version string with the last abbreviated commit id + dirty to the kernel version.

您可以使用上面的Git命令报告修改,删除或添加的文件.无论是否保存,导出或使用这些更改,都应将这些更改提交到树中.提交更改后,您需要重建内核.

You can use the above Git command to report modified, removed, or added files. You should commit those changes to the tree regardless of whether they will be saved, exported, or used. Once you commit the changes, you need to rebuild the kernel.

要强制提取并提交所有这些未决的更改,请输入以下内容:

To force a pickup and commit of all such pending changes, enter the following:

 $ git add .
 $ git commit -s -a -m "getting rid of -dirty"

或者,使用make -j2 LOCALVERSION="-customstring"获取自定义字符串

Alternatively, use the make -j2 LOCALVERSION="-customstring" to get the custom string

这篇关于Linux内核:内核版本字符串,后接"+"号或“肮脏"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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