2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 18:19:40 +00:00

fix(bmcsetup): settle after IBM port change and support long BMC passwords

Two small robustness fixes for bmcsetup:

- After changing the BMC network port on IBM boards (IPMIMFG 2), the BMC LAN
  configuration was not yet ready; add a 15s settle before continuing. Gated
  inside the IBM branch, so no other vendor is affected.

- Set a password longer than 16 characters using ipmitool's 20-byte form, but
  only when the password actually exceeds 16 chars, so a BMC that supports only
  16-byte passwords is never asked for a length it cannot store.

Recovered from the unmerged lenovobuild branch (949532f3, 78fa7758; the password
change adapted to use the 20-byte form only for long passwords).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
This commit is contained in:
Vinícius Ferrão
2026-07-23 21:14:01 -03:00
parent cf44f51463
commit 563a083627
+8 -2
View File
@@ -196,6 +196,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
@@ -219,6 +220,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
@@ -600,8 +602,12 @@ 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
# Set the password for the specified user. A password longer than 16 chars
# needs the 20-byte IPMI 2.0 form; shorter ones use the default so a
# 16-byte-only BMC is not asked for a length it cannot store.
PWSIZE=""
if [ ${#bmcp} -gt 16 ]; then PWSIZE=20; fi
while ! ipmitool -d $idev user set password $USERSLOT "$bmcp" $PWSIZE; do
sleep 1
let TRIES=TRIES+1
if [ $TRIES -gt $TIMEOUT ]; then break; fi