9

On system start up I currently see Linux 4.0.0-rc6yy and 4.0.0-rc6yy.old from the bootloader menu. I'm not certain where they came from. I suspect "yy" is arbitrary but can someone explain the ".old" suffix?

Also can someone explain what CONFIG_LOCALVERSION and CONFIG_LOCALVERSION_AUTO is from .config? I've looked them up but am still unclear about their use. Many thanks.

1 Answer 1

10

When you are installing your kernel the responsible script is copying kernel image and initramfs into your /boot directory. If a previous kernel image with the same name already exist, it is renamed by appending .old to its name.

CONFIG_LOCALVERSION:

Append an extra string to the end of your kernel version. This will show up when you type uname, for example. The string you set here will be appended after the contents of any files with a filename matching localversion* in your object and source tree, in that order. Your total string can be a maximum of 64 characters.

That means if you want you can give a special version number or name to your customized kernel. If you type "-MyNewKernel" your kernel should look: Linux 4.0.0-MyNewKernel.

CONFIG_LOCALVERSION_AUTO:

This will try to automatically determine if the current tree is a release tree by looking for git tags that belong to the current top of tree revision.
A string of the format -gxxxxxxxx will be added to the localversion appended after any matching localversion1 files, and after the value set in CONFIG_LOCALVERSION.

1 (The actual string used here is the first eight characters produced by running the command:

$ git rev-parse --verify HEAD

which is done within the script "scripts/setlocalversion".)

That means if it is enabled the unique SCM (source control management) tag reported by setlocalversion (or .scmversion) is appended to the kernel version, if it exists. For example if a git tree is found, the revision number will be appended if it exists. The result could look: Linux 4.0.0-MyNewKernel-ga2cfc42. For mores info you could check in your source tree scipts/setlocalversion.

3
  • 1
    I'm not 100% sure but I don't think it's necessarily the first eight characters. I've just hit a situation where it was 11 characters. My guess is that the number of characters is at least 8 but will include as many characters as needed in order to be unique. It seems it's actually git rev-parse --verify --short HEAD. Commented May 9, 2017 at 23:40
  • quite right! i thought the script was ignoring my config but it doesn't, when there's a tag the script takes the tag and not the hash, makes sence when u thin about it... :-) Commented Jun 7, 2017 at 7:17
  • The answer is great. But, it would be nice to explain where to find these informations. In the kernel source code, you can type make menuconfig to have a nice TUI with a navigation of all these options. Why make menuconfig? See the kernel documentation. Commented Nov 10, 2024 at 19:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.