Don't add “+” to linux kernel version

后端 未结 4 1838
星月不相逢
星月不相逢 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 00:59

    To prevent the script scripts/setlocalversion to append the + to the end of the kernel local version, create an empty .scmversion file in the root of the kernel sources.

    touch .scmversion
    

    this way, you'll be able to leave LOCALVERSION as is in the kernel configuration file, in case you want to append a local signature to the kernel name.

    0 讨论(0)
  • 2020-12-13 01:01

    Manipulating scripts/setlocalversion seems to be the only way for me. Force return in scm_version():

    scm_version()
    {
            local short
            short=false
            **return**
    
    0 讨论(0)
  • 2020-12-13 01:03

    Add this line to your local.conf if you're using yocto and imx soc

    SCMVERSION_pn-linux-imx = ""
    

    Tested on imx-4.9.88-2.0.0_ga release

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题