diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index d4f528a11..466cc8167 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -9,6 +9,15 @@ if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then . $str_dir_name/nicutils.sh fi error_code=0 +######################################################################### +# ifdown/ifup will not be executed in diskful provision postscripts stage +######################################################################### +reboot_nic_bool=1 +if [ -z "$UPDATENODE" ] || [ $UPDATENODE -ne 1 ] ; then + if [ "$NODESETSTATE" = "install" ] && ! grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then + reboot_nic_bool=0 + fi +fi function configipv4(){ str_if_name=$1 str_v4ip=$2 @@ -978,7 +987,9 @@ else if [ "$str_os_type" = "debian" ];then ifdown --force $str_nic_name > /dev/null else - ifdown $str_nic_name > /dev/null + if [ $reboot_nic_bool -eq 1 ]; then + ifdown $str_nic_name > /dev/null + fi fi fi #delete all old ip address @@ -1057,11 +1068,13 @@ else error_code=1 fi else - echo "bring up ip" - ifup $str_nic_name - if [ $? -ne 0 ]; then - log_error "ifup $str_nic_name failed." - error_code=1 + if [ $reboot_nic_bool -eq 1 ]; then + echo "bring up ip" + ifup $str_nic_name + if [ $? -ne 0 ]; then + log_error "ifup $str_nic_name failed." + error_code=1 + fi fi fi fi diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index ea86d4320..d72a4b00e 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -28,6 +28,16 @@ uniq="uniq" xargs="xargs" modprobe="modprobe" +######################################################################### +# ifdown/ifup will not be executed in diskful provision postscripts stage +######################################################################### +reboot_nic_bool=1 +if [ -z "$UPDATENODE" ] || [ $UPDATENODE -ne 1 ] ; then + if [ "$NODESETSTATE" = "install" ] && ! grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then + reboot_nic_bool=0 + fi +fi + ###################################################### # # log lines @@ -885,7 +895,7 @@ function create_bridge_interface { local _pretype="" local _port="" #pre nic local _mtu="" - + rc=0 # parser input arguments while [ -n "$1" ]; do @@ -970,8 +980,10 @@ function create_bridge_interface { inattrs="$cfg" # bring up interface formally - lines=`$ifdown $ifname; $ifup $ifname` - rc=$? + if [ $reboot_nic_bool -eq 1 ]; then + lines=`$ifdown $ifname; $ifup $ifname` + rc=$? + fi if [ $rc -ne 0 ]; then log_warn "ifup $ifname failed with return code equals to $rc" echo "$lines" \ @@ -1062,8 +1074,10 @@ function create_ethernet_interface { inattrs="$cfg" # bring up interface formally - true || lines=`$ifdown $ifname; $ifup $ifname` - rc=$? + if [ $reboot_nic_bool -eq 1 ]; then + lines=`$ifdown $ifname; $ifup $ifname` + rc=$? + fi if [ $rc -ne 0 ]; then log_warn "ifup $ifname failed with return code equals to $rc" echo "$lines" \ @@ -1188,8 +1202,10 @@ function create_vlan_interface { inattrs="$cfg" if [ x$xcatnet != x ]; then # bring up interface formally - lines=`$ifdown $ifname.$vlanid; $ifup $ifname.$vlanid` - rc=$? + if [ $reboot_nic_bool -eq 1 ]; then + lines=`$ifdown $ifname.$vlanid; $ifup $ifname.$vlanid` + rc=$? + fi if [ $rc -ne 0 ]; then log_warn "ifup $ifname.$vlanid failed with return code equals to $rc" echo "$lines" \ @@ -1486,8 +1502,10 @@ function create_bond_interface { xcatnet=$xcatnet \ inattrs="$cfg" if [ x$xcatnet != x ]; then - lines=`$ifdown $ifname; $ifup $ifname 2>&1` - rc=$? + if [ $reboot_nic_bool -eq 1 ]; then + lines=`$ifdown $ifname; $ifup $ifname 2>&1` + rc=$? + fi if [ $rc -ne 0 ]; then log_warn "ifup $ifname failed with return code equals to $rc" echo "$lines" \