Merge pull request #1578 from JonathonHall-Purism/config-automatic-boot-delay

initrd/bin/config-gui.sh: Allow configuring automatic boot
This commit is contained in:
tlaurion 2024-01-09 15:12:03 -05:00 committed by GitHub
commit 90d1c2e9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 59 additions and 1 deletions

View File

@ -2,5 +2,6 @@
include $(pwd)/boards/UNTESTED_p8z77-m_pro-tpm1-maximized/UNTESTED_p8z77-m_pro-tpm1-maximized.config
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_BOARD_NAME="P8Z77-M PRO-HOTP"

View File

@ -37,6 +37,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -38,6 +38,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -37,6 +37,7 @@ CONFIG_MBEDTLS=y
CONFIG_DROPBEAR=y
CONFIG_MSRTOOLS=y
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Uncomment only one of the following block
#Required for graphical gui-init (FBWhiptail)

View File

@ -38,6 +38,7 @@ CONFIG_MBEDTLS=y
CONFIG_DROPBEAR=y
CONFIG_MSRTOOLS=y
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Uncomment only one of the following block
#Required for graphical gui-init (FBWhiptail)

View File

@ -37,6 +37,7 @@ CONFIG_MBEDTLS=y
CONFIG_DROPBEAR=y
CONFIG_MSRTOOLS=y
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Uncomment only one of the following block
#Required for graphical gui-init (FBWhiptail)

View File

@ -38,6 +38,7 @@ CONFIG_MBEDTLS=y
CONFIG_DROPBEAR=y
CONFIG_MSRTOOLS=y
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Uncomment only one of the following block
#Required for graphical gui-init (FBWhiptail)

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -40,6 +40,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -2,5 +2,6 @@
include $(pwd)/boards/t440p-maximized/t440p-maximized.config
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_BOARD_NAME="ThinkPad T440p-hotp-maximized"

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -2,5 +2,6 @@
include $(pwd)/boards/w541-maximized/w541-maximized.config
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_BOARD_NAME="ThinkPad W541-hotp-maximized"

View File

@ -42,6 +42,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -37,6 +37,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -54,6 +54,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -45,6 +45,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -44,6 +44,7 @@ CONFIG_TPMTOTP=y
#HOTP based remote attestation for supported USB Security dongle
#With/Without TPM support
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
#Nitrokey Storage admin tool
CONFIG_NKSTORECLI=n

View File

@ -2,5 +2,6 @@
include $(pwd)/boards/z220-cmt-maximized/z220-cmt-maximized.config
CONFIG_HOTPKEY=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_BOARD_NAME="Hewlett-Packard Z220 Convertible Minitower (HOTP)"

View File

@ -54,9 +54,14 @@ while true; do
'J' " $(get_config_display_action "$CONFIG_USE_BLOB_JAIL") Firmware Blob Jail"
)
# Automatic boot
dynamic_config_options+=(
'M' " Configure automatic boot"
)
# Basic-only options for automatic boot
[ "$CONFIG_BASIC" = "y" ] && dynamic_config_options+=(
'A' " $(get_inverted_config_display_action "$CONFIG_BASIC_NO_AUTOMATIC_DEFAULT") automatic default boot"
'A' " $(get_inverted_config_display_action "$CONFIG_BASIC_NO_AUTOMATIC_DEFAULT") automatic default boot option"
'U' " $(get_config_display_action "$CONFIG_BASIC_USB_AUTOBOOT") USB automatic boot"
)
@ -401,6 +406,37 @@ while true; do
fi
fi
;;
"M" )
if [ -z "$CONFIG_AUTO_BOOT_TIMEOUT" ]; then
current_msg="Automatic boot is currently disabled."
elif [ "$CONFIG_AUTO_BOOT_TIMEOUT" = 1 ]; then
current_msg="Currently boots automatically after 1 second."
else
current_msg="Currently boots automatically after $CONFIG_AUTO_BOOT_TIMEOUT seconds."
fi
whiptail --title "Automatic Boot" \
--menu "$CONFIG_BRAND_NAME can boot automatically. Select the amount of time to wait\nbefore booting.\n\n$current_msg" 0 80 10 \
"0" "Don't boot automatically" \
"1" "1 second" \
"5" "5 seconds" \
"10" "10 seconds" \
"C" "Cancel" \
2>/tmp/whiptail
new_setting="$(cat /tmp/whiptail)"
if ! [ "$new_setting" = "C" ]; then
if [ "$new_setting" = "0" ]; then
new_setting= # Empty disables automatic boot
current_msg="$CONFIG_BRAND_NAME will not boot automatically."
elif [ "$new_setting" = "1" ]; then
current_msg="$CONFIG_BRAND_NAME will boot automatically after 1 second."
else
current_msg="$CONFIG_BRAND_NAME will boot automatically after $new_setting seconds."
fi
set_user_config "CONFIG_AUTO_BOOT_TIMEOUT" "$new_setting"
whiptail --title 'Config change successful' \
--msgbox "$current_msg\nSave the config change and reboot for it to go into effect." 0 80
fi
;;
"A" )
if [ "$CONFIG_BASIC_NO_AUTOMATIC_DEFAULT" != "y" ]; then
if (whiptail --title 'Disable automatic default boot?' \