common/rc: print out kernel version too
authorMauricio Faria de Oliveira <mfo@canonical.com>
Wed, 10 Jul 2019 17:58:09 +0000 (14:58 -0300)
committerEryu Guan <guaneryu@gmail.com>
Fri, 12 Jul 2019 05:24:14 +0000 (13:24 +0800)
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.

Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index dcd591b33b87d03473ffd138c70a0fe9c5472970..000a7cc821cf0fe00f8f1ea2191ca29b404aad14 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -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"
 }