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

FirmwareValidator: automatically validate previously validated image on revert #2225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ljahn
Copy link

@ljahn ljahn commented Jan 12, 2025

Fixes #2213

When a firmware is validated, its commit hash is now saved in littlefs (/.system/autovalidator.dat)
On startup, the firmware now checks its hash against the one in the file and if they are identical and the image is not validated yet, it automatically does so.
This means that on revert to a previously validated firmware (obviously without validating the current one), the old image will self validate.

There are a lot of changed files, because the validator now needs file system access and therefore needs to be constructed earlier and passed down into DisplayApp and SystemTask. I subjectively chose to put it next to settingsController wherever possible, but if there is any rule where to put it, the change is easy.

This needs a small change in InfiniSim, PR there is: InfiniTimeOrg/InfiniSim#167

Copy link

github-actions bot commented Jan 12, 2025

Build size and comparison to main:

Section Size Difference
text 373148B 204B
data 948B 0B
bss 22544B 8B

@ljahn
Copy link
Author

ljahn commented Jan 13, 2025

Found that AlarmController writes its information to /.system/ and moved the autovalidator file there as well.

@mark9064 mark9064 added the enhancement Enhancement to an existing app/feature label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing app/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation UI Not Updated When Reset
2 participants