Skip to content

Commit

Permalink
[E1031] add platform specific reboot command support (sonic-net#15889)
Browse files Browse the repository at this point in the history
* [E1031] add platform specific reboot command support

Why I did it
E1031: add platform specific cold reboot support

How I did it
Use the CPLD to trigger board level power cycle when cold reboot

How to verify it
Do reboot stress test and check the reboot cause history

* [E1031] try to umount filesystem before power cycle reboot

* [E1031] remove fstrim in customized reboot script
  • Loading branch information
qnos authored Aug 3, 2023
1 parent b23ec06 commit 9a7eb49
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/platform_reboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

declare -r CPLD_SETREG_PATH="/sys/bus/platform/devices/e1031.smc/setreg"

sync ; sync
umount -fa > /dev/null 2&>1

# Board level power cycle
echo "0x0113 0xAA" > ${CPLD_SETREG_PATH}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

REBOOT_USER=$(logname)
REBOOT_TIME=$(date)
declare -r REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"

echo "User issued 'reboot' with platform-specific command [User: ${REBOOT_USER}, Time: ${REBOOT_TIME}]" > ${REBOOT_CAUSE_FILE}
sync

0 comments on commit 9a7eb49

Please sign in to comment.