2023-03-13 12:51:42 -04:00
|
|
|
#!/bin/ash
|
|
|
|
. /etc/ash_functions
|
2023-02-18 12:58:43 -05:00
|
|
|
|
2023-02-20 11:01:17 -05:00
|
|
|
TRACE "Under /bin/poweroff"
|
2017-07-22 14:57:46 -04:00
|
|
|
|
2023-03-08 16:20:21 -05:00
|
|
|
# Shut down TPM
|
|
|
|
if [ "$CONFIG_TPM" = "y" ]; then
|
|
|
|
tpmr shutdown
|
|
|
|
fi
|
|
|
|
|
2023-05-23 14:25:03 +02:00
|
|
|
# Run special EC-based poweroff for Nitropad-Nxx
|
|
|
|
if [ "${CONFIG_BOARD%_*}" = nitropad-nv41 || "${CONFIG_BOARD%_*}" = nitropad-ns51 ]; then
|
|
|
|
/bin/nitropad-shutdown.sh
|
|
|
|
fi
|
|
|
|
|
2017-07-22 14:57:46 -04:00
|
|
|
# Sync all mounted filesystems
|
|
|
|
echo s > /proc/sysrq-trigger
|
|
|
|
|
|
|
|
# Remount all mounted filesystems in read-only mode
|
|
|
|
echo u > /proc/sysrq-trigger
|
|
|
|
|
|
|
|
# Shut off the system
|
|
|
|
echo o > /proc/sysrq-trigger
|