From b23d6d661554269eed4139a3d69c370e46a7dcff Mon Sep 17 00:00:00 2001 From: adorsey-NOAA Date: Thu, 18 Jul 2019 17:56:05 -0400 Subject: [PATCH] Automatically find first unlocked user slot Instead of relying on hard coded offsets, query each slot's status with ```ipmitool channel getaccess``` and use the first slot that is unlocked. This fixes an issue on certain Cray x86 nodes that have arbitrary locked IPMI user slots. --- xCAT-genesis-scripts/usr/bin/bmcsetup | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index fa5955adb..2bf6386aa 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -429,6 +429,14 @@ for user in $BMCUS; do USERSLOT=$((`ipmitool raw 6 0x44 1 1|awk '{print $3}'` + 1)) fi if [ "$USERSLOT" == 0 -o -z "$LOCKEDUSERS" ]; then USERSLOT=2; fi + # automatically find first unlocked user slot + for slot in {1..16}; do + USERLOCKED=`ipmitool channel getaccess $LANCHAN $slot | grep Fixed | awk '{print $4}'` + if [ "$USERLOCKED" == "No" ]; then + USERSLOT=$slot + break + fi + done if [ "$ISITE" = 1 ]; then allowcred.awk & CREDPID=$!