diskimage-builder/elements/ilo/init.d/50-ilo-firmware
Robert Collins 027dcc2dbe Add support for flashing ILO BMC's from ramdisks
This is more than a bit hard to test, requiring as it does an actual
iLO BMC, so sadly I have no tests :(.

HP Hardware really wants to be running latest firmware, and its
commonly agreed that one place where it can be sanely applied is in
the deploy environment, so this is my long threatened implementation
of that.

Change-Id: I3117a250d0d0eb8ee33eb4b15c837485a5cbf476
2014-08-28 17:07:03 +01:00

23 lines
733 B
Plaintext

if [ -d /ilo ]; then
find /ilo -type f \( -name flash_ilo3 -o -name flash_ilo4 \) | while read FWNAME
do
cd "$(dirname "$FWNAME")"
logname="$(basename "$(dirname "$FWNAME")").log"
echo Running $FWNAME
"$FWNAME" --silent --log "$logname"
result=$?
echo Finished $FWNAME with result $?
cat "$logname"
#avoid leaking space during large runs
rm "$logname"
if [ $result -eq 2 ]; then
echo "Firmware already up to date"
elif [ $result -eq 4 ]; then
echo "Firmware not applicable to machine"
elif [ $result -ne 0 ]; then
echo "Error applying firmware"
troubleshoot
fi
done
fi