[Mellanox] align platform_reboot to use "hardware reboot" (#3320)

Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
This commit is contained in:
Mykola F 2019-08-19 19:53:07 +03:00 committed by Joe LeVeque
parent 32793274a1
commit 8d5e37dd34

View File

@ -4,6 +4,7 @@ declare -r EXIT_SUCCESS="0"
declare -r EXIT_ERROR="1"
declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh"
declare -r SYSFS_PWR_CYCLE="/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/pwr_cycle"
FORCE_REBOOT="no"
@ -20,7 +21,7 @@ function ParseArguments() {
ParseArguments "$@"
${FW_UPGRADE_SCRIPT} --upgrade
${FW_UPGRADE_SCRIPT} --upgrade --verbose
EXIT_CODE="$?"
if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
echo "Failed to burn MLNX FW: errno=${EXIT_CODE}"
@ -31,4 +32,6 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
fi
fi
exec /sbin/reboot $@
echo 1 > $SYSFS_PWR_CYCLE
sleep 3
echo 0 > $SYSFS_PWR_CYCLE