Skip to content

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%)

@robin-nitrokey
Copy link
Member Author

This was implemented in #580 and #600.

@robin-nitrokey robin-nitrokey deleted the static-mut branch March 10, 2025 22:55
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.

4 participants