Skip to content

Commit

Permalink
init: load usb modules for devices using USB keyboard
Browse files Browse the repository at this point in the history
Some (out of tree) servers require use of a USB keyboard, and need
the USB kernel modules loaded prior to checking for keypress to enter
a recovery console. Since loading the modules affects the value in PRC5
and can cause issues putting a LUKS key in TPM, guard the loading of the
USB modules with CONFIG_USB_KEYBOARD and remove the unguarded call from
gui-init.

This should resolve issues linuxboot#603 and linuxboot#674.

Signed-off-by: Matt DeVillier <[email protected]>
  • Loading branch information
MrChromebox committed Feb 19, 2020
1 parent f0d85ba commit 6b5adcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions initrd/bin/gui-init
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ clean_boot_check()
"Clean Boot Detected - Perform OEM Factory Reset?" "$CONFIG_WARNING_BG_COLOR"
}

# enable USB to load modules for external kb
enable_usb

if detect_boot_device ; then
# /boot device with installed OS found
clean_boot_check
Expand Down
5 changes: 5 additions & 0 deletions initrd/init
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ if [ ! -z "$CONFIG_BOOT_RECOVERY_SERIAL" ]; then
> "$CONFIG_BOOT_RECOVERY_SERIAL" 2>&1 &
fi

# load USB modules for boards using a USB keyboard
if [ "$CONFIG_USB_KEYBOARD" = "y" ]; then
enable_usb
fi

# If the user has been holding down r, enter a recovery shell
# otherwise immediately start the configured boot script.
# We don't print a prompt, since this is a near instant timeout.
Expand Down

0 comments on commit 6b5adcc

Please sign in to comment.