Read system info from os-release and update the info to identifier the
type of KVM for IBM z Systems.
the s390utils source code.
---
cpi.initd | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/cpi.initd b/cpi.initd
index 80977fb..97e87e3 100644
--- a/cpi.initd
+++ b/cpi.initd
@@ -39,12 +39,23 @@ start() {
if [ -d $cpipath ]; then
retval=0
- echo LINUX > $cpipath/system_type 2> /dev/null || retval=1
+ systype=LINUX
+ syslevel=`uname -r`
+ if [ -f /etc/os-release ]; then
+ while read OS_LINE; do
+ eval "$OS_LINE"
+ done < /etc/os-release
+ if [ $ID = "kvmibm" ]; then
+ systype=KVMIBM
+ syslevel=$VERSION
+ fi
+ fi
+ echo $systype > $cpipath/system_type 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo "$SYSTEM_NAME" > $cpipath/system_name 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo "$SYSPLEX_NAME" > $cpipath/sysplex_name 2> /dev/null || retval=1
- level_maj=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 1`
- level_min=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 2`
- level_mic=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 3`
+ level_maj=`echo $syslevel | cut -d '-' -f 1 | cut -d '.' -f 1`
+ level_min=`echo $syslevel | cut -d '-' -f 1 | cut -d '.' -f 2`
+ level_mic=`echo $syslevel | cut -d '-' -f 1 | cut -d '.' -f 3`
level=`printf '%02x%02x%02x' $level_maj $level_min $level_mic`
[ $retval -eq 0 ] && echo $level > $cpipath/system_level 2> /dev/null || retval=1
--
2.1.0