From 2aa3136094940b174e93a3e3769799dee2d8576a Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 8 May 2017 02:47:33 -0400 Subject: [PATCH] add set channel access on to apply network setting for OpenBMC --- xCAT-genesis-scripts/bin/bmcsetup | 32 ++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 9e5a2ce80..cbd787605 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -266,7 +266,7 @@ elif [ "$IPMIMFG" == "674" ]; then # DELL ipmitool delloem lan set shared with lom$BMCPORT &>/dev/null ipmitool delloem lan set shared with failover all loms &>dev/null fi -elif [ "$IPMIMFG" == "42817" -a "$XPROD" == "16975" ]; then +elif [ "$IPMIMFG" = "42817" -a "$XPROD" = "16975" ]; then ISOPENBMC=1 fi @@ -385,18 +385,40 @@ for b in $BMCVLAN; do let idev=idev+1 done -# After network commands are issued, pause to allow the BMC to apply (OpenPower) -snooze + # update the node status to 'bmcready' for openbmc, no more configuration is needed. if [ ! -z "$ISOPENBMC" ]; then + # To enable network configuration for openbmc + let idev=0 + TRIES=0 + bmc_config_rc=0 + # Set Channel Access to apply network setting + #while ! ipmitool -d $idev lan set $LANCHAN access on; do + while ! ipmitool -d $idev raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do + snooze + let TRIES=TRIES+1 + if [ $TRIES -gt $TIMEOUT ]; then + bmc_config_rc=1 + break; + fi + done + # update the node status to 'bmcready' if [ ! -z "$XCATMASTER" ]; then - updateflag.awk $XCATMASTER 3002 "installstatus bmcready" + if [ "$bmc_config_rc" = "0" ]; then + # Wait for some time for the new network setting is ready + snooze + updateflag.awk $XCATMASTER 3002 "installstatus bmcready" + else + updateflag.awk $XCATMASTER 3002 "installstatus failed" + fi fi rm -f /tmp/ipmicfg.xml - exit 0 + exit $bmc_config_rc fi +# After network commands are issued, pause to allow the BMC to apply (OpenPower) +snooze let idev=NUMBMCS-1 for user in $BMCUS; do