Friday 27 December 2013

What does # in the output of "uname -a" or "uname -v" denote ?


Following is output of "uname -a" command


[pbankar@linux-node-1 linux-3.9.2]$ uname -a
Linux linux-node-1 3.9.2 #6 SMP Tue Jul 30 02:24:56 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux


       I got detailed information regarding all field of output of uname but one. I was not able to find what exactly #6 means in above output. After some analysis I found this value is taken from .version file at top of kernel source tree.
       First time when you compile kernel source and use it, # is 1 next time when you edit some file from same source or add patch to kernel and compile it again keeping kernel string same, # becomes 2. While compiling you can see following message when make is about to complete its work

Kernel: arch/x86/boot/bzImage is ready  (#7)

The same # number is propagated to uname output. I doubt whether kernel keeps all bzImages. For above example where # is 7 I looked into directory arch/x86/boot/ but there is only one bzImage. I also don't think these different # versions can be kept at a time on system. For one exact kernel only one # can be installed on system. It will only upgrade existing #