From ab308e6b89fd6d719d61e74c3e62e65d46f2ec46 Mon Sep 17 00:00:00 2001 From: notgivenby Date: Tue, 5 May 2026 01:37:23 -0400 Subject: [PATCH] fix USB keyboard initialization Signed-off-by: notgivenby Signed-off-by: Thierry Laurion --- initrd/etc/functions.sh | 10 +++++----- initrd/init | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/initrd/etc/functions.sh b/initrd/etc/functions.sh index 66e9bb9b6..eb20375ca 100644 --- a/initrd/etc/functions.sh +++ b/initrd/etc/functions.sh @@ -1151,12 +1151,12 @@ enable_usb_keyboard() { # For resiliency, test CONFIG_USB_KEYBOARD_REQUIRED explicitly rather # than having it imply CONFIG_USER_USB_KEYBOARD at build time. # Otherwise, if a user got CONFIG_USER_USB_KEYBOARD=n in their - # config.user by mistake (say, by copying config.user from a laptop to a - # desktop/server), they could lock themselves out, only recoverable by - # hardware flash. + # config.user by mistake, they could lock themselves out. if [ "$CONFIG_USB_KEYBOARD_REQUIRED" = y ] || [ "$CONFIG_USER_USB_KEYBOARD" = y ]; then - insmod.sh /lib/modules/usbhid.ko || DIE "usbhid: module load failed" - fi + enable_usb + wait_for_usb_devices + insmod.sh /lib/modules/usbhid.ko || DIE "usbhid: module load failed" +fi } # ------- End of functions coming from /etc/ash_functions diff --git a/initrd/init b/initrd/init index 73bfde2f8..8ac4d4fc5 100755 --- a/initrd/init +++ b/initrd/init @@ -188,7 +188,7 @@ fi # load USB modules for boards using a USB keyboard if [ "$CONFIG_USB_KEYBOARD_REQUIRED" = y ] || [ "$CONFIG_USER_USB_KEYBOARD" = "y" ]; then - enable_usb + enable_usb_keyboard fi # Set the keyboard keymap if defined, file exists, and loadkeys is available