open-power / HTX

Apache License 2.0
14 stars 19 forks source link

scripts/ver: Fix ver script to report complete Linux version #122

Closed vipinparashar closed 6 years ago

vipinparashar commented 6 years ago

Change ver script to extract Linux release and version details from /etc/os-release file.

This pull request fixes issue #121

vipinparashar commented 6 years ago

Without Change

For SLES15:

                       OS: GNU/Linux
               OS Version:  Welcome to SUSE Linux Enterprise Server 15 RC1 (ppc64le) - Kernel \r (\l).   
                                  eth0: \4{eth0} \6{eth0}                              <-----
                                                                                                 <--- Garbage display
           Kernel Version: 4.12.14-13.5-default

SLES 12 SP3:

                       OS: GNU/Linux
               OS Version: SUSE Linux Enterprise Server 12 (ppc64le)  <--- Only SLES12 displayed
                                                                                                           SP3 is missing
           Kernel Version: 4.4.103-6.38-default

Ubuntu 18.04

                       OS: GNU/Linux
               OS Version: Ubuntu Bionic Beaver (development branch) \n \l   <-- Only Code name displayed
           Kernel Version: 4.15.0-12-generic

With Change

SLES15 =======
OS: GNU/Linux OS Version: SLES 15 Kernel Version: 4.12.14-13.5-default

SLES12 SP3

                       OS: GNU/Linux
               OS Version: SLES 12-SP3 
           Kernel Version: 4.4.103-6.38-default

Ubuntu 18.04

                       OS: GNU/Linux
               OS Version: Ubuntu 18.04 LTS (Bionic Beaver) 
           Kernel Version: 4.15.0-12-generic