Don't add “+” to linux kernel version

后端 未结 4 1843
星月不相逢
星月不相逢 2020-12-13 00:38

I am building linux kernel, if my kernel under git, then kernel version every time is:

Image Name:   Linux-2.6.39+

If I am not using git, t

4条回答
  •  执念已碎
    2020-12-13 01:11

    The plus sign at the end of your version string is there as an indicator that the kernel was built from modified sources (that is, there were non-committed changes). This is also indicated by the comments in scripts/setlocalversion.

    To avoid the '+' being appended despite having a dirty working directory, simply set LOCALVERSION explicityly when running make:

    make LOCALVERSION=
    

    You may also have to change the configuration option CONFIG_LOCALVERSION_AUTO to n in your kernel config (.config) before building:

    sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" .config
    

提交回复
热议问题