[mlnx-fw-upgrade] Add FW reactivation in case 2 FW upgrades were done without reboot (#17092) (#17286)
This commit is contained in:
parent
afe382a5f9
commit
a32c370b83
@ -30,6 +30,7 @@ declare -r VERBOSE_MIN="${VERBOSE_ERROR}"
|
||||
|
||||
declare -r EXIT_SUCCESS="0"
|
||||
declare -r EXIT_FAILURE="1"
|
||||
declare -r FW_ALREADY_UPDATED_FAILURE="2"
|
||||
|
||||
declare -r QUERY_CMD="mlxfwmanager --query"
|
||||
declare -r LIST_CONTENT_CMD="mlxfwmanager --list-content"
|
||||
@ -233,6 +234,22 @@ function RunFwUpdateCmd() {
|
||||
fi
|
||||
|
||||
ERROR_CODE="$?"
|
||||
|
||||
if [[ "${ERROR_CODE}" == "${FW_ALREADY_UPDATED_FAILURE}" ]]; then
|
||||
LogInfo "FW reactivation is required. Reactivating and updating FW ..."
|
||||
local -r _MST_DEVICE="$(GetMstDevice)"
|
||||
local -r _CMD="flint -d ${_MST_DEVICE} ir"
|
||||
output=$(eval "${_CMD}")
|
||||
|
||||
if [[ "${VERBOSE_LEVEL}" -eq "${VERBOSE_MAX}" ]]; then
|
||||
output=$(eval "${COMMAND}")
|
||||
else
|
||||
output=$(eval "${COMMAND}") >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
ERROR_CODE="$?"
|
||||
|
||||
if [[ "${ERROR_CODE}" != "${EXIT_SUCCESS}" ]]; then
|
||||
failure_msg="${output#*Fail : }"
|
||||
ExitFailure "FW Update command: ${COMMAND} failed with error: ${failure_msg}"
|
||||
|
Loading…
Reference in New Issue
Block a user