mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-21 13:57:52 +00:00
9c3fb35358
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
33 lines
896 B
Bash
Executable File
33 lines
896 B
Bash
Executable File
#!/bin/ash
|
|
. /etc/ash_functions
|
|
|
|
TRACE "Under /bin/reboot"
|
|
|
|
if [ "$CONFIG_DEBUG_OUTPUT" = "y" ]; then
|
|
#Generalize user prompt to continue reboot or go to recovery shell
|
|
read -r -n 1 -s -p "Press any key to continue reboot or 'r' to go to recovery shell: " REPLY
|
|
echo
|
|
if [ "$REPLY" = "r" ] || [ "$REPLY" = "R" ]; then
|
|
recovery "Reboot call bypassed to go into recovery shell to debug"
|
|
fi
|
|
fi
|
|
|
|
# Shut down TPM
|
|
if [ "$CONFIG_TPM" = "y" ]; then
|
|
tpmr shutdown
|
|
fi
|
|
|
|
# Run special EC-based poweroff for Nitropad-Nxx
|
|
if [ "${CONFIG_BOARD%_*}" = nitropad-nv41 ] || [ "${CONFIG_BOARD%_*}" = nitropad-ns51 ]; then
|
|
/bin/nitropad-shutdown.sh
|
|
fi
|
|
|
|
# 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
|