Skip to content

Commit 9a7eb49

Browse files
authored
[E1031] add platform specific reboot command support (#15889)
* [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
1 parent b23ec06 commit 9a7eb49

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
declare -r CPLD_SETREG_PATH="/sys/bus/platform/devices/e1031.smc/setreg"
4+
5+
sync ; sync
6+
umount -fa > /dev/null 2&>1
7+
8+
# Board level power cycle
9+
echo "0x0113 0xAA" > ${CPLD_SETREG_PATH}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
REBOOT_USER=$(logname)
4+
REBOOT_TIME=$(date)
5+
declare -r REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"
6+
7+
echo "User issued 'reboot' with platform-specific command [User: ${REBOOT_USER}, Time: ${REBOOT_TIME}]" > ${REBOOT_CAUSE_FILE}
8+
sync

0 commit comments

Comments
 (0)