trustfence-initramfs: use "busybox halt" instead of "poweroff"

The poweroff command is not available in the initramfs due to a missing
sysvinit/systemd dependency. Use the busybox "halt" command, since it's
available regardless of the init manager used. Rework the error message and
script variables accordingly.

https://jira.digi.com/browse/DEL-6983

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2020-02-12 15:42:43 +01:00 committed by Gonzalo Ruiz
parent 6aa852dccd
commit 6caecc5c53
1 changed files with 4 additions and 4 deletions

View File

@ -15,13 +15,13 @@
#
#===============================================================================
POWEROFF_TIME="10"
HALT_TIME="10"
error() {
[ "${#}" != "0" ] && printf "\n[ERROR]: %s\n\n" "${1}"
echo "The system will poweroff in ${POWEROFF_TIME} seconds"
sleep "${POWEROFF_TIME}"
sync && poweroff -f
echo "The system will halt in ${HALT_TIME} seconds"
sleep "${HALT_TIME}"
sync && busybox halt -f
}
# Main