From 13a12d157b2a013d968fad8d4e9902d6159c4df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 1 Mar 2022 03:03:26 +0100 Subject: [PATCH] Move enable_usb earlier It is going to be enabled later anyway (if CONFIG_HOTPKEY=y), so it can also be simplified by enabling it at the very beginning. This enables USB keyboard consistently during all boot menus, including the "No Bootable OS Found" prompt. It isn't a big deal for "normal" laptop usage, but it is important for automatic tests and also non-laptop systems. --- initrd/bin/gui-init | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/initrd/bin/gui-init b/initrd/bin/gui-init index 7927ac0f..f8f21e45 100755 --- a/initrd/bin/gui-init +++ b/initrd/bin/gui-init @@ -202,7 +202,6 @@ update_hotp() { if [ -x /bin/hotp_verification ]; then HOTP=`unseal-hotp` - enable_usb if ! hotp_verification info ; then if ! whiptail $BG_COLOR_WARNING --clear \ --title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \ @@ -251,7 +250,6 @@ clean_boot_check() # check for USB security token if [ "$CONFIG_HOTPKEY" = "y" ]; then - enable_usb if ! gpg --card-status > /dev/null ; then return fi @@ -543,6 +541,10 @@ else HOTPKEY_BRANDING="HOTP USB Security Dongle" fi +if [ "$CONFIG_HOTPKEY" = "y" ]; then + enable_usb +fi + if detect_boot_device ; then # /boot device with installed OS found clean_boot_check