2023-03-13 16:51:42 +00:00
|
|
|
#!/bin/ash
|
|
|
|
. /etc/ash_functions
|
2023-02-18 17:58:43 +00:00
|
|
|
|
2023-02-20 16:01:17 +00:00
|
|
|
TRACE "Under /bin/reboot"
|
2017-07-22 18:57:46 +00:00
|
|
|
|
2023-10-24 17:13:47 +00:00
|
|
|
if [ "$CONFIG_DEBUG_OUTPUT" = "y" ]; then
|
2023-10-23 19:57:12 +00:00
|
|
|
#Generalize user prompt to continue reboot or go to recovery shell
|
2023-10-24 17:13:47 +00:00
|
|
|
read -r -n 1 -s -p "Press any key to continue reboot or 'r' to go to recovery shell: " REPLY
|
2023-10-23 19:57:12 +00:00
|
|
|
echo
|
2023-10-24 17:13:47 +00:00
|
|
|
if [ "$REPLY" = "r" ] || [ "$REPLY" = "R" ]; then
|
|
|
|
recovery "Reboot call bypassed to go into recovery shell to debug"
|
2023-10-23 19:57:12 +00:00
|
|
|
fi
|
2023-10-23 17:11:49 +00:00
|
|
|
fi
|
|
|
|
|
2023-03-08 21:20:21 +00:00
|
|
|
# Shut down TPM
|
|
|
|
if [ "$CONFIG_TPM" = "y" ]; then
|
|
|
|
tpmr shutdown
|
|
|
|
fi
|
|
|
|
|
2023-05-23 12:25:03 +00:00
|
|
|
# Run special EC-based poweroff for Nitropad-Nxx
|
2023-12-18 21:29:15 +00:00
|
|
|
if [ "$CONFIG_BOARD" = "nitropad-nv41" ] || [ "$CONFIG_BOARD" = "nitropad-ns50" ]; then
|
2023-10-27 15:15:48 +00:00
|
|
|
/bin/nitropad-shutdown.sh
|
2023-05-23 12:25:03 +00:00
|
|
|
fi
|
|
|
|
|
2017-07-22 18:57:46 +00:00
|
|
|
# Sync all mounted filesystems
|
|
|
|
echo s > /proc/sysrq-trigger
|
|
|
|
|
|
|
|
# Remount all mounted filesystems in read-only mode
|
|
|
|
echo u > /proc/sysrq-trigger
|
|
|
|
|
|
|
|
# Immediately reboot the system, without unmounting or syncing filesystems
|
|
|
|
echo b > /proc/sysrq-trigger
|