[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
This commit is contained in:
Ikki Zhu 2023-08-03 08:20:53 +08:00 committed by GitHub
parent b23ec06a87
commit 9a7eb495c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -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}

View File

@ -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