2014-07-16 06:58:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-07-16 06:58:02 +00:00
|
|
|
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
|