-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
init: assign CONFIG_TPM depending on /dev/tpm0 presence #1200
Conversation
That doesn't sound right, no. I guess I could emultate that behavior by building a TPM enabled board config and disable coreboot support... |
Actually, first use case to test your PR on top of the Qemu PR by disabling coreboot support. |
What Qemu PR? I've tested it on Talos board running inside PPC64 Qemu (coreboot build for emulation separately), which has no TPM. |
Recreated qemu setup without fbwhiptail with resulting patch on top of #1188
Then
Swap terminal to host and killall swtpm after qemu is luanch to simulate tpm cut-off (without changing coreboot config) Question being why gui-init is not showing Otherwise, I think it is normal that you see no drive error if your QEMU instance doesn't have any disk attached, and if there was a disk attached without partitions, you should get something similar as above. |
combine_configs is not merging |
Produces Basically, the last redefinition of the variable is the one valid, whatever if they are strings being written differently, this is not the source of the problem. |
@SergiiDmytruk : the following part was missing to produce
The following is cleaner, while combine_configs is still really dumb, while working:
And produces expected behavior (if swtpm is killed before linux creates tpm0 device) Without disk but with a TPM should bring us at: Resetting TPM generates Qr code after ownership (if TPM is not owned; otherwise gnerating HOTP/TOTP works) and then TOTP shows TPMTOTP code as expected, matching phone: |
Signed-off-by: Sergii Dmytruk <[email protected]>
Skip only GPG key check, but always init TOTP and HOTP. Signed-off-by: Sergii Dmytruk <[email protected]>
e56e1a1
to
75748e8
Compare
Those extra quotes shouldn't be there or checks like
That was the problem, I just didn't know why GPG, TOTP and HOTP are initialized together. If we're actually only want to skip GPG initialization, the variable should say that and initialization of TOTP and HOTP should be unconditional, which is how I commited it. |
Right. I focused on trying to produce exports that would match under /tmp/config after combine_config But since combine_configs is just concatenating /etc/config and /etc/config.user under /tmp/config and sourcing the later, we don't really care about producing a perfect match. does it right |
Makes sense but will have to retest. |
@JonathonHall-Purism @jans23: Will leave this open for you to review until let's say wednesday? I would appreciate a quick review/testing on your side/use cases and a note here saying it works for you as well (should), but as said before LGTM and ready for merge to me. |
Looks good to me - I did not quite have time to test today but will tomorrow, it's very similar to the patches we're currently carrying. |
Tested 13v2 (TPM) and mini v2 (no TPM). LGTM 👍 |
A small piece of #836 (this file) to avoid adding
-tmp
/-no-tpm
board variants in #1002 and other cases.Is it OK that after
gui-init
printsUnable to locate /boot files on any mounted disk
message$skip_to_menu
equalstrue
,$TOTP
isn't set and main menu doesn't displayNO TPM
until you press r?Also, with these changes all
CONFIG_TPM
in board files is ignored, so maybe it needs to be removed from them or dynamic behaviour should be used only ifCONFIG_TPM=y
in config.