Skip to contentSkip to conversation

common/rc: print out kernel version too

PATCH In review Mauricio Faria de Oliveira 2 participants 3 messages Jul 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/rc: print out kernel version too

The kernel version (uname -v) may also be needed in addition to the kernel release (uname -r) in order to properly identify and distinguish different kernel builds in some cases/distributions.

For example, in the Ubuntu kernel package the test/debug string is usually a suffix to the version field, not the release field.

  $ uname -rv
  4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019
  $ uname -rv
  4.15.0-51-generic #55+test20190520b1 SMP Mon May 20 11:57:40 -03 2019

Looking at other OSes uname(1) man pages it looks like '-v' is quite standard, and the Linux man page only cites '-p' and '-i' as non-portable, so the change should be OK. The only caller is the 'check' script for the header print out, so it's contained.

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index dcd591b33b87..000a7cc821cf 100644
@@ -2794,7 +2794,7 @@ _full_platform_details()
 {
      local os=`uname -s`
      local host=`hostname -s`
-     local kernel=`uname -r`
+     local kernel=`uname -rv`
      local platform=`uname -m`
      echo "$os/$platform $host $kernel"
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mauricio Faria de Oliveira

The kernel version (uname -v) may also be needed in addition to the kernel release (uname -r) in order to properly identify and distinguish different kernel builds in some cases/distributions.

For example, in the Ubuntu kernel package the test/debug string is usually a suffix to the version field, not the release field.

  $ uname -rv
  4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019
Quoted 8 lines
  $ uname -rv
  4.15.0-51-generic #55+test20190520b1 SMP Mon May 20 11:57:40 -03 2019

Looking at other OSes uname(1) man pages it looks like '-v' is quite standard, and the Linux man page only cites '-p' and '-i' as non-portable, so the change should be OK. The only caller is the 'check' script for the header print out, so it's contained.

I'm just considering that -v also prints more clutter like the kernel build date. Do you need it? It seems off for the PLATFORM line, which has stuff not kernel related. Can you trim the output a bit to remove it?

Anyway,

Signature · 1 line
Gabriel Krisman Bertazi
#2 lore raw

,

Quoted 22 lines · Gabriel Krisman Bertazi
Quoted 10 lines · Mauricio Faria de Oliveira

The kernel version (uname -v) may also be needed in addition to the kernel release (uname -r) in order to properly identify and distinguish different kernel builds in some cases/distributions.

For example, in the Ubuntu kernel package the test/debug string is usually a suffix to the version field, not the release field.

  $ uname -rv
  4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019
Quoted 8 lines
  $ uname -rv
  4.15.0-51-generic #55+test20190520b1 SMP Mon May 20 11:57:40 -03 2019

Looking at other OSes uname(1) man pages it looks like '-v' is quite standard, and the Linux man page only cites '-p' and '-i' as non-portable, so the change should be OK. The only caller is the 'check' script for the header print out, so it's contained.

Quoted 5 lines

I'm just considering that -v also prints more clutter like the kernel build date. Do you need it? It seems off for the PLATFORM line, which has stuff not kernel related. Can you trim the output a bit to remove it?

It indeed prints out some clutter that's usually not required, but it's hard to tell which parts of it may (not) be useful in general for particular/different users, to consider trimming it,
so the complete string seemed to be the way go IMO.

Quoted 3 lines

Anyway,

Thanks for reviewing.

Quoted 3 lines

--
Gabriel Krisman Bertazi

cheers,

--
Mauricio Faria de Oliveira