Skip to content

Commit 139ecb8

Browse files
authored
Merge pull request #1206 from tlaurion/remove_whiptail_clear_so_console_has_errors
whiptail: no more whiptail reseting console on call (--clear)
2 parents c1fb04c + 81b4bb7 commit 139ecb8

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

initrd/bin/config-gui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ while true; do
1414
unset param
1515
else
1616
unset menu_choice
17-
whiptail $BG_COLOR_MAIN_MENU --clear --title "Config Management Menu" \
17+
whiptail $BG_COLOR_MAIN_MENU --title "Config Management Menu" \
1818
--menu "This menu lets you change settings for the current BIOS session.\n\nAll changes will revert after a reboot,\n\nunless you also save them to the running BIOS." 0 80 10 \
1919
'b' ' Change the /boot device' \
2020
's' ' Save the current configuration to the running BIOS' \

initrd/bin/flash-gui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e -o pipefail
77

88
while true; do
99
unset menu_choice
10-
whiptail $BG_COLOR_MAIN_MENU --clear --title "Firmware Management Menu" \
10+
whiptail $BG_COLOR_MAIN_MENU --title "Firmware Management Menu" \
1111
--menu "Select the firmware function to perform\n\nRetaining settings copies existing settings to the new firmware:\n* Keeps your GPG keyring\n* Keeps changes to the default /boot device\n\nErasing settings uses the new firmware as-is:\n* Erases any existing GPG keyring\n* Restores firmware to default factory settings\n* Clears out /boot signatures\n\nIf you are just updating your firmware, you probably want to retain\nyour settings." 0 80 10 \
1212
'f' ' Flash the firmware with a new ROM, retain settings' \
1313
'c' ' Flash the firmware with a new ROM, erase settings' \

initrd/bin/gpg-gui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ gpg_add_key_reflash() {
140140

141141
while true; do
142142
unset menu_choice
143-
whiptail $BG_COLOR_MAIN_MENU --clear --title "GPG Management Menu" \
143+
whiptail $BG_COLOR_MAIN_MENU --title "GPG Management Menu" \
144144
--menu 'Select the GPG function to perform' 0 80 10 \
145145
'r' ' Add GPG key to running BIOS and reflash' \
146146
'a' ' Add GPG key to standalone BIOS image and flash' \

initrd/bin/gui-init

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mount_boot()
2222

2323
# CONFIG_BOOT_DEV doesn't exist or couldn't be mounted, so give user options
2424
BG_COLOR_MAIN_MENU=$BG_COLOR_ERROR
25-
whiptail $BG_COLOR_ERROR --clear --title "ERROR: No Bootable OS Found!" \
25+
whiptail $BG_COLOR_ERROR --title "ERROR: No Bootable OS Found!" \
2626
--menu " No bootable OS was found on the default boot device $CONFIG_BOOT_DEV.
2727
How would you like to proceed?" 0 80 4 \
2828
'b' ' Select a new boot device' \
@@ -66,7 +66,7 @@ verify_global_hashes()
6666
if ( cd /boot && sha256sum -c "$TMP_HASH_FILE" > /tmp/hash_output ) then
6767
return 0
6868
elif [ ! -f $TMP_HASH_FILE ]; then
69-
if (whiptail $BG_COLOR_ERROR --clear --title 'ERROR: Missing Hash File!' \
69+
if (whiptail $BG_COLOR_ERROR --title 'ERROR: Missing Hash File!' \
7070
--yesno "The file containing hashes for /boot is missing!\n\nIf you are setting this system up for the first time, select Yes to update\nyour list of checksums.\n\nOtherwise this could indicate a compromise and you should select No to\nreturn to the main menu.\n\nWould you like to update your checksums now?" 0 80) then
7171
if update_checksums ; then
7272
BG_COLOR_MAIN_MENU=""
@@ -114,7 +114,7 @@ verify_global_hashes()
114114
fi
115115
fi
116116

117-
if (whiptail $BG_COLOR_ERROR --clear --title 'ERROR: Boot Hash Mismatch' --yesno "$TEXT" 0 80) then
117+
if (whiptail $BG_COLOR_ERROR --title 'ERROR: Boot Hash Mismatch' --yesno "$TEXT" 0 80) then
118118
if update_checksums ; then
119119
BG_COLOR_MAIN_MENU=""
120120
return 0;
@@ -163,7 +163,7 @@ update_totp()
163163
TOTP=`unseal-totp`
164164
if [ $? -ne 0 ]; then
165165
BG_COLOR_MAIN_MENU=$BG_COLOR_ERROR
166-
whiptail $BG_COLOR_ERROR --clear --title "ERROR: TOTP Generation Failed!" \
166+
whiptail $BG_COLOR_ERROR --title "ERROR: TOTP Generation Failed!" \
167167
--menu " ERROR: Heads couldn't generate the TOTP code.\n
168168
If you have just completed a Factory Reset, or just reflashed
169169
your BIOS, you should generate a new HOTP/TOTP secret.\n
@@ -204,7 +204,7 @@ update_hotp()
204204
if [ -x /bin/hotp_verification ]; then
205205
HOTP=`unseal-hotp`
206206
if ! hotp_verification info ; then
207-
if ! whiptail $BG_COLOR_WARNING --clear \
207+
if ! whiptail $BG_COLOR_WARNING \
208208
--title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \
209209
--yes-button "Retry" --no-button "Skip" \
210210
--yesno "Your $HOTPKEY_BRANDING was not detected.\n\nPlease insert your $HOTPKEY_BRANDING" 0 80 ; then
@@ -267,7 +267,7 @@ check_gpg_key()
267267
GPG_KEY_COUNT=`gpg -k 2>/dev/null | wc -l`
268268
if [ $GPG_KEY_COUNT -eq 0 ]; then
269269
BG_COLOR_MAIN_MENU=$BG_COLOR_ERROR
270-
whiptail $BG_COLOR_ERROR --clear --title "ERROR: GPG keyring empty!" \
270+
whiptail $BG_COLOR_ERROR --title "ERROR: GPG keyring empty!" \
271271
--menu "ERROR: Heads couldn't find any GPG keys in your keyring.\n\nIf this is the first time the system has booted,\nyou should add a public GPG key to the BIOS now.\n\nIf you just reflashed a new BIOS, you'll need to add at least one\npublic key to the keyring.\n\nIf you have not just reflashed your BIOS, THIS COULD INDICATE TAMPERING!\n\nHow would you like to proceed?" 0 80 4 \
272272
'g' ' Add a GPG key to the running BIOS' \
273273
'F' ' OEM Factory Reset / Re-Ownership' \
@@ -313,7 +313,7 @@ prompt_auto_default_boot()
313313
show_main_menu()
314314
{
315315
date=`date "+%Y-%m-%d %H:%M:%S %Z"`
316-
whiptail $BG_COLOR_MAIN_MENU --clear --title "$MAIN_MENU_TITLE" \
316+
whiptail $BG_COLOR_MAIN_MENU --title "$MAIN_MENU_TITLE" \
317317
--menu "$date\nTOTP: $TOTP | HOTP: $HOTP" 0 80 10 \
318318
'd' ' Default boot' \
319319
'r' ' Refresh TOTP/HOTP' \
@@ -344,7 +344,7 @@ show_main_menu()
344344

345345
show_options_menu()
346346
{
347-
whiptail $BG_COLOR_MAIN_MENU --clear --title "HEADS Options" \
347+
whiptail $BG_COLOR_MAIN_MENU --title "HEADS Options" \
348348
--menu "" 0 80 10 \
349349
'b' ' Boot Options -->' \
350350
't' ' TPM/TOTP/HOTP Options -->' \
@@ -400,7 +400,7 @@ show_options_menu()
400400

401401
show_boot_options_menu()
402402
{
403-
whiptail $BG_COLOR_MAIN_MENU --clear --title "Boot Options" \
403+
whiptail $BG_COLOR_MAIN_MENU --title "Boot Options" \
404404
--menu "Select A Boot Option" 0 80 10 \
405405
'm' ' Show OS boot menu' \
406406
'u' ' USB boot' \
@@ -427,7 +427,7 @@ show_boot_options_menu()
427427

428428
show_tpm_totp_hotp_options_menu()
429429
{
430-
whiptail $BG_COLOR_MAIN_MENU --clear --title "TPM/TOTP/HOTP Options" \
430+
whiptail $BG_COLOR_MAIN_MENU --title "TPM/TOTP/HOTP Options" \
431431
--menu "Select An Option" 0 80 10 \
432432
'g' ' Generate new TOTP/HOTP secret' \
433433
'r' ' Reset the TPM' \
@@ -493,7 +493,7 @@ reset_tpm()
493493
echo "Returning to the main menu"
494494
fi
495495
else
496-
whiptail $BG_COLOR_ERROR --clear --title 'ERROR: No TPM Detected' --msgbox "This device does not have a TPM.\n\nPress OK to return to the Main Menu" 0 80
496+
whiptail $BG_COLOR_ERROR --title 'ERROR: No TPM Detected' --msgbox "This device does not have a TPM.\n\nPress OK to return to the Main Menu" 0 80
497497
fi
498498
}
499499

initrd/bin/kexec-select-boot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ get_menu_option() {
102102
MENU_OPTIONS="$MENU_OPTIONS $n ${name} "
103103
done < $TMP_MENU_FILE
104104

105-
whiptail --clear --title "Select your boot option" \
105+
whiptail --title "Select your boot option" \
106106
--menu "Choose the boot option [1-$n, a to abort]:" 0 80 8 \
107107
-- $MENU_OPTIONS \
108108
2>/tmp/whiptail || die "Aborting boot attempt"
@@ -136,7 +136,7 @@ confirm_menu_option() {
136136
if [ "$gui_menu" = "y" ]; then
137137
default_text="Make default"
138138
[[ "$CONFIG_TPM_NO_LUKS_DISK_UNLOCK" = "y" ]] && default_text="${default_text} and boot"
139-
whiptail $BG_COLOR_WARNING --clear --title "Confirm boot details" \
139+
whiptail $BG_COLOR_WARNING --title "Confirm boot details" \
140140
--menu "Confirm the boot details for $name:\n\n$(echo $kernel| fold -s -w 80) \n\n" 0 80 8 \
141141
-- 'd' "${default_text}" 'y' "Boot one time" \
142142
2>/tmp/whiptail || die "Aborting boot attempt"

initrd/bin/mount-usb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if [ -z ${USB_MOUNT_DEVICE} ]; then
6565
done < /tmp/usb_disk_list
6666

6767
MENU_OPTIONS="$MENU_OPTIONS a Abort"
68-
whiptail $BG_COLOR --clear --title "Select your USB disk" \
68+
whiptail $BG_COLOR --title "Select your USB disk" \
6969
--menu "Choose your USB disk [1-$n, a to abort]:" 0 80 8 \
7070
-- $MENU_OPTIONS \
7171
2>/tmp/whiptail

initrd/bin/oem-factory-reset

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ report_integrity_measurements()
298298
HOTP=`unseal-hotp` > /dev/null 2>&1
299299
enable_usb
300300
if ! hotp_verification info > /dev/null 2>&1 ; then
301-
whiptail $CONFIG_WARNING_BG_COLOR --clear --title 'WARNING: Please insert your HOTP enabled USB Security dongle' --msgbox "Your HOTP enabled USB Security dongle was not detected.\n\nPlease remove it and insert it again." 0 80
301+
whiptail $CONFIG_WARNING_BG_COLOR --title 'WARNING: Please insert your HOTP enabled USB Security dongle' --msgbox "Your HOTP enabled USB Security dongle was not detected.\n\nPlease remove it and insert it again." 0 80
302302
fi
303303
# Don't output HOTP codes to screen, so as to make replay attacks harder
304304
hotp_verification check $HOTP
@@ -330,7 +330,7 @@ report_integrity_measurements()
330330
fi
331331

332332
#Show results
333-
whiptail $MAIN_MENU_BG_COLOR --clear --title "Measured Integrity Report" --msgbox "$date\nTOTP: $TOTP | HOTP: $HOTP\n/BOOT INTEGRITY: $HASH\n\nPress OK to continue or Ctrl+Alt+Delete to reboot" 0 80
333+
whiptail $MAIN_MENU_BG_COLOR --title "Measured Integrity Report" --msgbox "$date\nTOTP: $TOTP | HOTP: $HOTP\n/BOOT INTEGRITY: $HASH\n\nPress OK to continue or Ctrl+Alt+Delete to reboot" 0 80
334334
fi
335335
}
336336

initrd/bin/usb-scan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ get_menu_option() {
2929
MENU_OPTIONS="$MENU_OPTIONS $n ${option}"
3030
done < /tmp/iso_menu.txt
3131

32-
whiptail $BG_COLOR_MAIN_MENU --clear --title "Select your ISO boot option" \
32+
whiptail $BG_COLOR_MAIN_MENU --title "Select your ISO boot option" \
3333
--menu "Choose the ISO boot option [1-$n, s for standard boot, a to abort]:" 0 80 8 \
3434
-- $MENU_OPTIONS \
3535
2>/tmp/whiptail || die "Aborting boot attempt"

initrd/etc/gui_functions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ file_selector()
4343
done < $FILE_LIST
4444

4545
MENU_OPTIONS="$MENU_OPTIONS a Abort"
46-
whiptail --clear --title "${MENU_TITLE}" \
46+
whiptail --title "${MENU_TITLE}" \
4747
--menu "${MENU_MSG} [1-$n, a to abort]:" 20 120 8 \
4848
-- $MENU_OPTIONS \
4949
2>/tmp/whiptail || die "Aborting"

0 commit comments

Comments
 (0)