From aaaa5755df300753d3121ee11a8fe19e8cf20aaf Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 23 Oct 2019 08:45:12 -0400 Subject: [PATCH 1/2] Revert "Rearrange bmcsetup" This reverts commit ff3e6c95570a50c6aaee307f194aa0d906052a33. --- xCAT-genesis-scripts/usr/bin/bmcsetup | 50 ++++++++++----------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index 1a9d17f48..5402cab54 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -183,7 +183,6 @@ if [ "$IPMIMFG" == 2 ]; then #IBM for p in $BMCPORT; do # Set the LAN Configuration Parameters (OEM) ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null - sleep 15 # Set the PEF Configuration Parameters (Platform Event Filtering) 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}'` @@ -210,7 +209,6 @@ if [ "$IPMIMFG" == 2 ]; then #IBM IFS=',' for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null - sleep 15 CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` logger -s -t $log_label -p local4.info "CURBMCPORT is $CURBMCPORT" while [ "$CURBMCPORT" -ne "$BMCPORT" ]; do @@ -240,7 +238,6 @@ elif [ "$IPMIMFG" == 20301 -o "$IPMIMFG" == 19046 -a "$XPROD" != 502 ] ; then for p in $BMCPORT; do unset IFS ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null - sleep 15 IFS=',' # after this change, we need to watch and wait to see that it # actually takes effect. On port change, the service processor @@ -432,32 +429,6 @@ fi # After network commands are issued, pause to allow the BMC to apply (OpenPOWER) snooze -let idev=NUMBMCS-1 -for bmcp in $BMCPW; do - if [ "$bmcp" = "" ]; then - continue - fi - DISABLEUSERS=$(ipmitool user list $LANCHAN|grep -v ^ID|grep -v 'NO ACCESS$'|awk '{print $1}') - # Get the User Slots - USERSLOT=`ipmitool -d $idev user list $LANCHAN |grep -v ^ID|awk '{print $1 " " $2}'|grep -w "$BMCUS"|awk '{print $1}'` - if [ -z "$USERSLOT" ]; then - USERSLOT=$((`ipmitool raw 6 0x44 1 1|awk '{print $3}'` + 1)) - fi - if [ "$USERSLOT" == 0 -o -z "$LOCKEDUSERS" ]; then USERSLOT=2; fi - if [ "$bmcp" = "" ]; then continue; fi - - TRIES=0 - # Set the password for the specified user - while ! ipmitool -d $idev user set password $USERSLOT "$bmcp"; do - sleep 1 - let TRIES=TRIES+1 - if [ $TRIES -gt $TIMEOUT ]; then break; fi - done - - TRIES=0 - let idev=idev-1 -done - let idev=NUMBMCS-1 for user in $BMCUS; do if [ "$user" = "" ]; then @@ -543,12 +514,27 @@ for user in $BMCUS; do if [ $TRIES -gt $TIMEOUT ]; then break; fi done fi - # Display the user list - logger -s -t $log_label -p local4.info "Set up following user table: " - ipmitool -d $idev user list $LANCHAN let idev=idev-1 done +let idev=NUMBMCS-1 +for bmcp in $BMCPW; do + if [ "$bmcp" = "" ]; then continue; fi + + TRIES=0 + # Set the password for the specified user + while ! ipmitool -d $idev user set password $USERSLOT "$bmcp"; do + sleep 1 + let TRIES=TRIES+1 + if [ $TRIES -gt $TIMEOUT ]; then break; fi + done + + logger -s -t $log_label -p local4.info "Set up following user table: " + TRIES=0 + # Display the user list + ipmitool -d $idev user list $LANCHAN + let idev=idev-1 +done let idev=NUMBMCS while [ $idev -gt 0 ]; do From 949532f362fb795a920ae0fc09374d8cdcfb2816 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 23 Oct 2019 08:46:32 -0400 Subject: [PATCH 2/2] Add sleep after port change The BMC net configuration was not yet ready in the wake of having had the port changed immediately. Put in an opportunity for net cfg to catch up. --- xCAT-genesis-scripts/usr/bin/bmcsetup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index 5402cab54..0e21e8ff5 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -192,6 +192,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM # Get the LAN Configuration Parameters (OEM) CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` done + sleep 15 let idev=idev+1 done unset IFS @@ -215,6 +216,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM sleep 1 CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` done + sleep 15 let idev=idev+1 done unset IFS @@ -252,6 +254,7 @@ elif [ "$IPMIMFG" == 20301 -o "$IPMIMFG" == 19046 -a "$XPROD" != 502 ] ; then sleep 1 CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` done + sleep 15 let idev=idev+1 done unset IFS