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

DISABLE_BACKUP is now powerfail-safe. #409

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

danielinux
Copy link
Member

@danielinux danielinux commented Feb 22, 2024

When DISABLE_BACKUP=1, by not checking/updating sector flags during copies from UPDATE to BOOT partitions, a copy operation getting interrupted by power failure will be less likely to cause problems to the integrity of the BOOT image. This is because in case of interruptions, the copy operation will be restarted from the first sector.

Idea taken from ZD17551.

By not checking/updating sector flags during copies from UPDATE to
BOOT partitions, a copy operation getting interrupted by power failure
will be less likely to cause problems to the integrity of the BOOT
image. This is because in case of interruptions, the copy operation
will be restarted from the first sector.
./wolfboot.elf powerfail 1a000 get_version 2>/dev/null
# fail on the last sector to stop the encrypt key save and state update
./wolfboot.elf powerfail 3e000 get_version 2>/dev/null
# may not trigger on non NVM_FLASH_WRITEONCE
Copy link
Contributor

@jpbland1 jpbland1 Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does NVM_FLASH_WRITEONCE get used with DISABLE_BACKUP? Would need to add a combo test for it, otherwise remove my ugly hack here. Also missing combo cases for things like HOME_FLAGS, not sure if it's relevant for this flag but otherwise looks good.

@danielinux
Copy link
Member Author

Thanks @jpbland1 - I've added two more test cases to check the combination of DISABLE_BACKUP with the two options mentioned above. Please consider for merging.

Copy link
Contributor

@jpbland1 jpbland1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested, looks good

@jpbland1 jpbland1 merged commit 3166b07 into wolfSSL:master Feb 26, 2024
79 checks passed
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.

2 participants