From 124b26d72fc6359d77c872b93c39027b6c504fef Mon Sep 17 00:00:00 2001 From: Mykola F <37578614+mykolaf@users.noreply.github.com> Date: Tue, 17 Sep 2019 19:38:30 +0300 Subject: [PATCH] [Mellanox] platform_reboot - sync & umount fs before power cycle (#3430) Signed-off-by: Mykola Faryma --- .../mellanox/x86_64-mlnx_msn2700-r0/platform_reboot | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot index d310210497..28c5aedc4e 100755 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot @@ -19,6 +19,14 @@ function ParseArguments() { done } +function SafePwrCycle() { + sync ; sync + umount -fa > /dev/null 2&>1 + echo 1 > $SYSFS_PWR_CYCLE + sleep 3 + echo 0 > $SYSFS_PWR_CYCLE +} + ParseArguments "$@" ${FW_UPGRADE_SCRIPT} --upgrade --verbose @@ -32,7 +40,4 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then fi fi -# perform "hardware" reboot -echo 1 > $SYSFS_PWR_CYCLE -sleep 3 -echo 0 > $SYSFS_PWR_CYCLE +SafePwrCycle