heads/initrd/bin/reboot
Jonathon Hall 0c4fdf343b
poweroff, reboot: Do not use bash
These need to work on legacy-flash boards.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
2023-03-13 12:51:42 -04:00

19 lines
375 B
Bash
Executable File

#!/bin/ash
. /etc/ash_functions
TRACE "Under /bin/reboot"
# Shut down TPM
if [ "$CONFIG_TPM" = "y" ]; then
tpmr shutdown
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