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

TPM jobs all seem to require a non-existant snap #1189

Open
bladernr opened this issue Apr 16, 2024 · 1 comment
Open

TPM jobs all seem to require a non-existant snap #1189

bladernr opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bladernr
Copy link
Collaborator

Bug Description

I was looking for a programmatic way to determine if a system has a TPM installed to avoid having to reboot into the Setup utility and hunt through those menus for clues. I found this in providers/base/units/tpm/tpm.pxu:

unit: job
id: query/tpm_version
category_id: tpm
_summary: Collect the output of tpm_version
_description:
 This job collects the output of "tpm_version" for inspection by a
 Certification engineer.
plugin: shell
requires: snap.name == 'tpm'
command: tpm.version 2>&1
estimated_duration: 1s
flags: preserve-locale preserve-cwd

And thought if that returned something it would be enough indication that a TPM is present, even if not active. But when I looked it seems that snap does not exist?

bladernr@galactica:~/development/checkbox/providers/base/units/tpm$ snap info tpm
error: no snap found for "tpm"
bladernr@galactica:~/development/checkbox/providers/base/units/tpm$ snap search tpm
Name                          Version                      Publisher             Notes  Summary
tpm2-tools-alexmurray         5.3                          alexmurray✪           -      TPM 2.0 utilities
tpm2-toolbox                  1.0-tpm2-tools+git-857e6fc7  timchen119            -      TPM 2.0 utilities
tpm2-simulator-chrisccoulson  0.1.0                        chrisccoulson         -      TPM 2.0 Reference Simulator
fwupd                         1.9.16                       richard-hughes        -      Firmware updates for Linux
theengs-gateway               1.4.0                        koen-vervloesem       -      Multi-platform BLE to MQTT gateway leveraging Theengs Decoder
httpmock-netlogger            0.1.2                        manu-gautier1394      -      A simple HTTP Server mock which log every network connections events
test-snapd-swtpm              0.1.0                        test-snaps-canonical  -      

It seems that every job in tpm.pxu contains the constraint snap.name == 'tpm' which, it seems, means none of those jobs will ever run. Unless that tpm snap does exist but is either hidden, or side loaded somehow?

bladernr@galactica:~/development/checkbox/providers/base/units/tpm$ grep snap.name *
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'
tpm.pxu:requires: snap.name == 'tpm'

To Reproduce

Review tpm.pxu and note the snap.name constraint
Search for the tpm snap and note it does not exist

Environment

Ubuntu

Relevant log output

See above in the description

Additional context

No response

@bladernr bladernr added the bug Something isn't working label Apr 16, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1403.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant