From 1d36f56327080a10b4c4ebebfb8a79a190e964eb Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 27 Mar 2019 00:06:32 -0400 Subject: [PATCH 1/3] add wicked check in confignetwork for sles --- xCAT/postscripts/nicutils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 3b7ac3127..22f499f92 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -1602,7 +1602,7 @@ function check_NetworkManager_or_network_service() { return 1 fi fi - checkservicestatus network > /dev/null 2>/dev/null + checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null if [ $? -eq 0 ]; then stopservice NetworkManager | log_lines info disableservice NetworkManager | log_lines info From 57465fc51599b2d6a81d68a23d8451de012c72c4 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 27 Mar 2019 01:06:30 -0400 Subject: [PATCH 2/3] keep configeth -s run first --- xCAT/postscripts/confignetwork | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 2e93ed63c..40f4d4ace 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -633,6 +633,27 @@ errorcode=0 #nictypes should support capital letters, for example, Ethernet and ethernet utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" +#get for installnic +installnic='' +installnic=`get_installnic` +instnic_conf=0 +if [ $boot_install_nic -eq 1 ];then + if [ -n "$installnic" ]; then + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + log_info "configure the install nic $installnic. " + instnic_conf=1 + configeth -s $installnic + if [ $? -ne 0 ]; then + errorcode=1 + fi + get_nic_cfg_file_content $installnic + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + else + log_error "Can not determine proper install nic." + errorcode=1 + fi +fi + #check if using NetworkManager or network service networkmanager_active=2 check_NetworkManager_or_network_service @@ -656,27 +677,6 @@ if [ $? -ne 0 ]; then fi fi -#get for installnic -installnic='' -installnic=`get_installnic` -instnic_conf=0 -if [ $boot_install_nic -eq 1 ];then - if [ -n "$installnic" ]; then - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - log_info "configure the install nic $installnic. " - instnic_conf=1 - configeth -s $installnic - if [ $? -ne 0 ]; then - errorcode=1 - fi - get_nic_cfg_file_content $installnic - echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - else - log_error "Can not determine proper install nic." - errorcode=1 - fi -fi - #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` From 68ea9257908e2b39e61cabfc8f732644b09b7d3d Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 27 Mar 2019 02:04:29 -0400 Subject: [PATCH 3/3] use ifup replace ip link set dev <> up, ifup can load NIC configure files in none nmcli case --- xCAT/postscripts/configeth | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 57dc72a12..c1147aa47 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -695,7 +695,7 @@ elif [ "$1" = "-s" ];then nmcli con up $con_name wait_for_ifstate $str_inst_nic UP 10 5 else - ip link set dev $str_inst_nic up + ifup $str_inst_nic fi fi if [ $? -ne 0 ]; then @@ -1111,7 +1111,7 @@ else nmcli con up $con_name wait_for_ifstate $str_nic_name UP 10 10 else - ip link set dev $str_nic_name up + ifup $str_nic_name fi if [ $? -ne 0 ]; then log_error "bring $str_nic_name up failed."