fix USB keyboard initialization#2102
Merged
tlaurion merged 1 commit intolinuxboot:masterfrom May 7, 2026
Merged
Conversation
c5a7057 to
7d476d4
Compare
Signed-off-by: notgivenby <notgivenby@gmail.com> Signed-off-by: Thierry Laurion <insurgo@riseup.net>
7d476d4 to
ab308e6
Compare
Collaborator
|
@notgivenby i've rebased on master and fixed indentation under ab308e6 but that makes me co-author. If you're ok with that commit, LGTM and ready to merge, let me know |
50 tasks
50 tasks
87a7317 to
ab308e6
Compare
Contributor
Author
I am very happy about it! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This commit solves the issue with the usb keyboard initialization for some boards that needed it. Initially discovered during my wip m900 port. Please see #2101
Initial Problem
Systems with
CONFIG_USB_KEYBOARD_REQUIRED=yorCONFIG_USER_USB_KEYBOARD=yneed USB keyboard support during initrd/early boot.Previously, the
initrd/initboot script only called:This enabled USB support, but it did not load the
usbhid.komodule required for USB keyboard input.As a result, systems that depend on a USB keyboard during early boot could be left without keyboard input. This could prevent users from interacting with the system during initrd, including cases where keyboard input is needed to unlock or recover the system.
Solution Description
The solution changes the USB keyboard initialization path so that
initrd/initcalls:instead of calling
enable_usbdirectly.The
enable_usb_keyboardfunction ininitrd/etc/functions.shnow performs the complete USB keyboard setup sequence:This ensures that when USB keyboard support is required or enabled, the system will:
usbhid.koUSB HID keyboard module.Changes
initrd/initto callenable_usb_keyboardfor USB keyboard setup.enable_usb_keyboardininitrd/etc/functions.shto:enable_usbwait_for_usb_devices/lib/modules/usbhid.koExpected Result
USB keyboards are now properly initialized during early boot when
CONFIG_USB_KEYBOARD_REQUIRED=yorCONFIG_USER_USB_KEYBOARD=y.Testing
usbhid.kois loaded throughenable_usb_keyboardwhen USB keyboard support is enabled.