gui-init: add Power Off to the Main Boot Menu

Add a main boot menu entry to power off. This enables users to
only verify the firmware integrity using OTP, and do nothing more.

After having left the device out of sight, one might want to do
a quick sanity check only.

Since we already have a script to safely power down, we make use of
it now.
This commit is contained in:
Martin Kepplinger 2019-05-24 11:23:28 +02:00
parent eb31354085
commit fbe39745b4

View File

@ -175,6 +175,7 @@ while true; do
--menu "$date\nTOTP: $TOTP | HOTP: $HOTP" 20 90 10 \
'y' ' Default boot' \
'a' ' Advanced Settings -->' \
'P' ' Power Off' \
'x' ' Exit to recovery shell' \
2>/tmp/whiptail || recovery "GUI menu failed"
@ -330,6 +331,10 @@ while true; do
continue
fi
if [ "$totp_confirm" = "P" ]; then
poweroff
fi
if [ "$totp_confirm" = "y" -o -n "$totp_confirm" ]; then
# Try to boot the default
mount_boot