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

Replace store statics #482

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Replace store statics #482

wants to merge 2 commits into from

Conversation

robin-nitrokey
Copy link
Member

This patch moves the statics storing the various storage components into
the local resources for the init tasks. This makes them sound and safe
to use. Unfortunately, this leads to a significant increase in binary
size.


Based on:

@robin-nitrokey
Copy link
Member Author

Using MaybeUninit instead of Option already improves the binary size a lot. Maybe I can find some more optimizations.

@robin-nitrokey
Copy link
Member Author

Of course this breaks the provisioner app which wants a mutable reference to the storage so that it can format the filesystem. Maybe we can just drop that feature. I don’t think we use it during provisioning, and for development devices, we have other means to format the IFS.

@daringer
Copy link
Collaborator

I think it should be fine to drop support for it - that's usually anyways only needed during provisioning - for development we have the debugger to do this job

The ReformatFilesystem command requires unsafe direct access to the
storage used by Trussed.  As it is not actually used, this patch removes
it from the provisioner app.
This patch moves the statics storing the various storage components into
the local resources for the init tasks.  This makes them sound and safe
to use.  Unfortunately, this leads to a significant increase in binary
size.
@nitrokey-ci
Copy link
Collaborator

No significant changes.

Insignifcant changes
metric value change
binary-size-nk3am 1431243 🔴 +7973 (+0.01%)
binary-size-nk3am-test 2032675 🔴 +10501 (+0.01%)
binary-size-nk3xn 513076 🔴 +2804 (+0.01%)
binary-size-nk3xn-test 550416 🔴 +3260 (+0.01%)
binary-size-nkpk 742941 🔴 +6520 (+0.01%)

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.

3 participants