diskimage-builder/elements/ilo/extra-data.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

26 lines
658 B
Bash
Executable File

#!/bin/bash
set -eu
set -o pipefail
if [ -z "${DIB_ILO_FIRMWARE_PATH:-}" ]; then
echo "DIB_ILO_FIRMWARE_PATH not set in ilo element" >&2
exit 0
fi
if [ ! -d "${DIB_ILO_FIRMWARE_PATH}" ]; then
echo "Firmware path not found: ${DIB_ILO_FIRMWARE_PATH}"
exit 1
fi
# We copy to /tmp because its temporary - we do a mv later into the initramfs
# image.
mkdir -p "$TMP_MOUNT_PATH/tmp/ilo/"
find "${DIB_ILO_FIRMWARE_PATH}" -type f \( -name '*.scexe' -o -name '*.exe' \) | while read FWNAME
do
TARGET="$TMP_MOUNT_PATH/tmp/ilo/$(basename "$FWNAME")"
echo Unpacking $FWNAME to $TARGET
bash "$FWNAME" "--unpack=$TARGET"
echo Done
done