From 7ac9dae5af948c7799a5c9c3740caa0c8be758b2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 20 Aug 2013 15:59:42 -0400 Subject: [PATCH] Attempt to fix bmcsetup problem where service processor changes after request to change too late --- xCAT-genesis-scripts/bin/bmcsetup | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 2cca4e2e9..758bb299d 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -54,6 +54,11 @@ if [ "$IPMIMFG" == 2 ]; then #IBM for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null ipmitool -d $idev raw 0x04 0x12 0x09 0x01 0x18 0x${p}1 0x00 > /dev/null + CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` + while [ "$CURBMCPORT" -ne "$BMCPORT" ]; do + sleep 1 + CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` + done let idev=idev+1 done fi @@ -67,7 +72,12 @@ if [ "$IPMIMFG" == 2 ]; then #IBM let idev=0 for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null - let idev=idev+1 + CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` + while [ "$CURBMCPORT" -ne "$BMCPORT" ]; do + sleep 1 + CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` + done + let idev=idev+1 done fi fi @@ -84,8 +94,17 @@ elif [ "$IPMIMFG" == 20301 ] ; then let idev=0 for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null - NEWPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0|awk '{print $2}'` - sleep 10 + # after this change, we need to watch and wait to see that it + # actually takes effect. On port change, the service processor + # does not migrate the network configuration over + # so we might be halfway through setting up when the net config + # reverts to dhcp then static, which setting a static ip for is + # considered invalid + CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` + while [ "$CURBMCPORT" -ne "$BMCPORT" ]; do + sleep 1 + CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` + done let idev=idev+1 done