Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] align platform reboot to use "hardware reboot" #3321

Merged
merged 4 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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}"
Expand All @@ -31,4 +32,7 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
fi
fi

exec /sbin/reboot $@
# perform "hardware" reboot
echo 1 > $SYSFS_PWR_CYCLE
sleep 3
echo 0 > $SYSFS_PWR_CYCLE

This file was deleted.

21 changes: 21 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot
Original file line number Diff line number Diff line change
@@ -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 $@