Skip to content

Commit 05bb871

Browse files
mykolafMykola Faryma
authored andcommitted
[Mellanox] platform_reboot - sync & umount fs before power cycle (sonic-net#3430)
Signed-off-by: Mykola Faryma <[email protected]>
1 parent 9f03af0 commit 05bb871

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ function ParseArguments() {
1919
done
2020
}
2121

22+
function SafePwrCycle() {
23+
sync ; sync
24+
umount -fa > /dev/null 2&>1
25+
echo 1 > $SYSFS_PWR_CYCLE
26+
sleep 3
27+
echo 0 > $SYSFS_PWR_CYCLE
28+
}
29+
2230
ParseArguments "$@"
2331

2432
${FW_UPGRADE_SCRIPT} --upgrade --verbose
@@ -32,6 +40,4 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
3240
fi
3341
fi
3442

35-
echo 1 > $SYSFS_PWR_CYCLE
36-
sleep 3
37-
echo 0 > $SYSFS_PWR_CYCLE
43+
SafePwrCycle

0 commit comments

Comments
 (0)