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/poweroff"
|
2017-07-22 18:57:46 +00:00
|
|
|
|
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-05-23 12:25:03 +00:00
|
|
|
/bin/nitropad-shutdown.sh
|
|
|
|
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
|
|
|
|
|
|
|
|
# Shut off the system
|
|
|
|
echo o > /proc/sysrq-trigger
|