trezor / trezor-firmware

:lock: Trezor Firmware Monorepo
https://trezor.io
Other
1.29k stars 637 forks source link

Figure out cross-model resource (non)sharing #2273

Open matejcik opened 2 years ago

matejcik commented 2 years ago

For Model T we need FIDO icons and some other resources in color. For models 1 and R, we need them in black & white. It would be great to have a way of excluding resources from the build that won't be used in the result.

A possible way forward is to move the resources to Rust, where either linker or conditional compilation would take care of it.

(doing just resources.rs generated by Mako should be pretty easy, given that we now have obj_module! and can expose individual images as attributes essentially for free. The generator can take care of inclusion/exclusion via directories, so, say:

would be nice and hopefully not too difficult to teach obj_module! about features)

mmilata commented 2 years ago

We already do have some conditionally included resources in rust code: https://github.com/trezor/trezor-firmware/blob/core/v2.5.1/core/embed/rust/src/ui/model_tt/theme.rs#L45-L55