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

Fixed flag comparison selecting most recent flags #470

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

danielinux
Copy link
Member

@danielinux danielinux commented Jul 17, 2024

Following up from #469 and expanding unit tests for NVM_FLASH_WRITEONCE, to consider all corner cases.

  • Added an explicit check for both uninitialized/invalid trailers, which now overrides 27c079b 310efc4 fix for "First time boot".
  • Once the headers are already compared, the flags comparison loop can start from offset '4' instead, checking for differences in the partition flags byte and the sector flags nibbles behind.
  • Expanded unit tests to cover all cases

@danielinux danielinux self-assigned this Jul 17, 2024
Taking into account the additional offset for PART_UPDATE_FLAGS at the
end of each flags sector when comparing two redundant flag sectors in
NVM_FLASH_WRITEONCE   FLAGS_HOME
Caveat: in case of powerfail during wolfBoot_update_trigger, the key
previously set may be lost. This is OK assuming that the update process
can resume from the previous step in the application (setting the key
before triggering the update).
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.

None yet

1 participant