2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Merge pull request #4044 from whowutwut/mellanox_sample_postscripts

Include sample postscripts to help admins check firmware version and update mellanox adapter firmware
This commit is contained in:
cxhong 2017-10-04 16:04:05 -04:00 committed by GitHub
commit 4864967d4a
2 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# Sample postscript that can be executed to check the Mellanox OFED version
# and adapter firmware level on the Mellanox adapters installed on the target nodes
#
#
BINARIES="ofed_info mst ibdev2netdev"
for PROG in ${BINARIES}; do
RC=`command -v ${PROG} >> /dev/nul 2>&1; echo $?`
if [[ ${RC} != 0 ]]; then
echo "${PROG} is not installed on this node, unable to check firmware levels."
exit 1
fi
done
MELLANOX_SOFTWARE=`ofed_info -s | cut -d: -f1`
echo "Mellanox Software: $MELLANOX_SOFTWARE"
mst start >> /dev/null
if [[ $? != 0 ]]; then
echo "Error: Could not start mst, cannot check adapter firmware level."
exit 1
fi
ibdev2netdev -v
exit 0

View File

@ -0,0 +1,62 @@
#!/bin/sh
#
# Sample postscript that can be executed to help update the firmware level on
# Mellanox hardware adapters on the target nodes
#
# This script requires passing in the path of the Mellanox OFED ISO
# located on the xCAT Management node under the /install directory.
#
# If OFED file is located here:
# /install/mlnxofed/MLNX_OFED_LINUX-4.1-4.0.7.1-rhel7.4alternate-ppc64le.iso
#
# Call the script as follows:
# updatenode <noderange> -P "update_mlnx_adapter_firmware /install/mlnxofed/MLNX_OFED_LINUX-4.1-4.0.7.1-rhel7.4alternate-ppc64le.iso"
#
MLNX_OFED_PATH=${1}
if [[ -z ${1} ]]; then
echo "Error: you must provide the path of the MLNX OFED ISO file"
exit 1
fi
WORKING_DIR="/"
MLNX_ISO_FILE=`basename ${MLNX_OFED_PATH}`
TARGET_ISO_FILE="${WORKING_DIR}/${MLNX_ISO_FILE}"
echo "==> Mellanox OFED PATH: ${MLNX_OFED_PATH}"
echo "==> Mellanox ODEF ISO: ${MLNX_ISO_FILE}"
if [[ -e ${TARGET_ISO_FILE} ]]; then
rm -f ${TARGET_ISO_FILE}
fi
echo "==> Retrieving file from http://${MASTER}/${MLNX_OFED_PATH}"
wget -q http://${MASTER}/${MLNX_OFED_PATH} -O ${TARGET_ISO_FILE}
ls -ltr ${TARGET_ISO_FILE}
MOUNT_DIR="${WORKING_DIR}/mlnx_tmp_iso_dir"
mkdir -p ${MOUNT_DIR}
mount -o ro,loop ${TARGET_ISO_FILE} ${MOUNT_DIR}
ls -ltr ${MOUNT_DIR}
${MOUNT_DIR}/mlnxofedinstall --fw-update-only
#
# Clean up
#
sleep 1
umount ${MOUNT_DIR}
rmdir ${MOUNT_DIR}
rm -f ${TARGET_ISO_FILE}
echo "==> "
echo "==> "
echo "==> REBOOT THIS MACHINE FOR THE NEW FIRMWARE LEVEL TO TAKE EFFECT."
echo "==> "
echo "==> "
exit 0