From 002d52a4933fe8db24259566df99255ad016ed98 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 17 Feb 2020 17:17:16 -0500 Subject: [PATCH] modify the postscripts to support SLE15 --- xCAT/postscripts/configbond | 3 +++ xCAT/postscripts/configeth | 3 +++ xCAT/postscripts/confignetwork | 3 +++ xCAT/postscripts/hardeths | 6 +++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/configbond b/xCAT/postscripts/configbond index 8b340428d..9903b9902 100755 --- a/xCAT/postscripts/configbond +++ b/xCAT/postscripts/configbond @@ -74,6 +74,9 @@ if [ "$str_os_type" = "linux" ];then elif [ -f "/etc/SuSE-release" -o -n "$str_temp" ];then str_os_type="sles" str_cfg_dir="/etc/sysconfig/network" + elif [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep -i SLE >/dev/null; then + str_os_type="sles" + str_cfg_dir="/etc/sysconfig/network" else showmsg "Only supports RHEL and SLES" "error" exit -1 diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index b2ca8a318..6fe9e14bf 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -413,6 +413,9 @@ if [ "$str_os_type" = "linux" ];then elif [ -f "/etc/SuSE-release" -o -n "$str_temp" ];then str_os_type="sles" str_cfg_dir="/etc/sysconfig/network/" + elif [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep -i SLE >/dev/null; then + str_os_type="sles" + str_cfg_dir="/etc/sysconfig/network" else str_os_type="redhat" str_cfg_dir="/etc/sysconfig/network-scripts/" diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index b73968385..1eb953edf 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -42,6 +42,9 @@ if [ -f "/etc/redhat-release" ];then elif [ -f "/etc/SuSE-release" -o -n "$str_temp" ];then is_sles=1 nwdir="/etc/sysconfig/network" +elif [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep -i SLE >/dev/null; then + is_sles=1 + nwdir="/etc/sysconfig/network" elif [ -f "/etc/debian_version" ];then nwdir="/etc/network/interfaces.d" is_debian=1 diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index 86dcce797..d6e3193e5 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -50,12 +50,16 @@ if [ -f /etc/os-release ] && (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus OSVER="cumulus" fi +if [ -f /etc/os-release ] && (cat /etc/os-release |grep NAME|grep -i SLE >/dev/null); then + OSVER="SLE" +fi + defgw=`ip route | grep default | awk '{print $3}' | head -n1` if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then echo `hostname` >/etc/hostname mv /etc/network/interfaces /etc/network/interfaces.old # this file will be filled up next -elif [ -f /etc/SuSE-release ] +elif [ -f /etc/SuSE-release ] || (pmatch $OSVER "SLE") then #SLES9 and SLES10, uses /etc/sysconfig/network/ifcfg-eth-id- #SLES11, uses /etc/sysconfig/network/ifcfg-eth