[Mellanox] align platform reboot to use "hardware reboot" (#3321)
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
This commit is contained in:
parent
cc6642300a
commit
2a7d8624cb
@ -4,6 +4,7 @@ declare -r EXIT_SUCCESS="0"
|
|||||||
declare -r EXIT_ERROR="1"
|
declare -r EXIT_ERROR="1"
|
||||||
|
|
||||||
declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh"
|
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"
|
FORCE_REBOOT="no"
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ function ParseArguments() {
|
|||||||
|
|
||||||
ParseArguments "$@"
|
ParseArguments "$@"
|
||||||
|
|
||||||
${FW_UPGRADE_SCRIPT} --upgrade
|
${FW_UPGRADE_SCRIPT} --upgrade --verbose
|
||||||
EXIT_CODE="$?"
|
EXIT_CODE="$?"
|
||||||
if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
|
if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
|
||||||
echo "Failed to burn MLNX FW: errno=${EXIT_CODE}"
|
echo "Failed to burn MLNX FW: errno=${EXIT_CODE}"
|
||||||
@ -31,4 +32,7 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /sbin/reboot $@
|
# perform "hardware" reboot
|
||||||
|
echo 1 > $SYSFS_PWR_CYCLE
|
||||||
|
sleep 3
|
||||||
|
echo 0 > $SYSFS_PWR_CYCLE
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../x86_64-mlnx_msn2700-r0/platform_reboot
|
|
21
device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot
Executable file
21
device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
declare -r EXIT_SUCCESS="0"
|
||||||
|
declare -r EXIT_ERROR="1"
|
||||||
|
|
||||||
|
FORCE_REBOOT="no"
|
||||||
|
|
||||||
|
function ParseArguments() {
|
||||||
|
while [ $# -ge 1 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-f|--force)
|
||||||
|
FORCE_REBOOT="yes"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
ParseArguments "$@"
|
||||||
|
|
||||||
|
exec /sbin/reboot $@
|
@ -1 +1 @@
|
|||||||
../x86_64-mlnx_msn3700-r0/platform_reboot
|
../x86_64-mlnx_msn2700_simx-r0/platform_reboot
|
Loading…
Reference in New Issue
Block a user