Search code examples
clinuxunixlinux-kerneluname

Adding some extra info in uname -v output string in linux kernel


On my Linux machine when i run

uname -v

it gives me

#83-Ubuntu SMP Wed Jan 4 11:12:07 UTC 2012

Now i am building my custom kernel and i need to show some flag/text info about build in this string ..

i want something like if some config are on then add BUILD-XYZ in that string

   #83-Ubuntu SMP Wed Jan 4 11:12:07 UTC 2012 BUILD-XYZ

if not then add BUILD-ABC in that.

  #83-Ubuntu SMP Wed Jan 4 11:12:07 UTC 2012 BUILD-ABC

Solution

  • The variable CONFIG_LOCALVERSION (inside your kernel .config file) let you set a custom string that will be appended to the kernel release number, thus shown when using 'uname'.

    Is that what you want?