Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usb keyboard at init #1362

Merged
merged 2 commits into from
Apr 3, 2023

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Mar 31, 2023

TPM2 board inclusion made bash required, and we missed early usb keyboard enablement+testing after moving some required init functions, but not all required ones, from functions to ash_functions, causing a regression on x230 usb-keyb and talos, requiring early usb keyboard support.

enable_usb function is moved /etc/ash_functions to be called from init, which otherwise don't find needed function, since init only sources the minimal ash_functions before switching to boot policy (gui-init or any other specified in board config)

That code is required to do measurements in PCR5 prior of actually loading the kernel modules drivers.
/sbin/insmod is actually a wrapper script calling busybox insmod after having measured modules to be loaded.
This prevents unsealing secrets which requires runtime related PCRs to be consistent to be unsealed.


As a reminder, Heads doesn't enable USB stack unless needed.
On host like the Talos II without ps2, USB support is required to interact with the machine early at boot.
And to have usb HID (USB keyboard support) the USB controllers drivers needs to be loaded. All of which is provvided by enable_usb function.

@krystian-hebel this PR addresses #1313 (comment)


I will test talos rom on top of this, and then rebase my commit on master instead of #1313 to merge this alone as fix on master so that you can rebase on master only including current relevant commit 35c34f4

@tlaurion tlaurion force-pushed the fix_usb_keyboard_at_init branch from 35c34f4 to c2d5c6e Compare March 31, 2023 19:36
@JonathonHall-Purism
Copy link
Collaborator

Thanks @tlaurion, the changes to functions and ash_functions look good to me. You might want to edit OP to say that enable_usb was moved, not that we're sourcing functions from init. (I agree with moving enable_usb, BTW, I think that's a bit cleaner.)

@tlaurion tlaurion force-pushed the fix_usb_keyboard_at_init branch from 6a4693a to 7c72c1a Compare April 3, 2023 16:00
tlaurion added 2 commits April 3, 2023 14:31
… keyboard can be enabled from init

Reminder: insmod is a bash script and will fail on legacy-flash boards (which should not enable USB_KEYBOARD anyway)
@tlaurion tlaurion force-pushed the fix_usb_keyboard_at_init branch from 7c72c1a to 8dbe85d Compare April 3, 2023 18:32
@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 3, 2023

@JonathonHall-Purism removed talos II commits from #1313 on which this was tested functional and modified OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants