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

[opentitantool] Erase header of other slot during rescue #25995

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

Conversation

jesultra
Copy link
Contributor

@jesultra jesultra commented Jan 23, 2025

I believe I have seen cases where the slot not being flashed during rescue still booted afterwards, meaning that the previous code flashing a zero-length image to the other slot may be ineffective. This PR changes the default behavior to flashing an 4kB image consisting entirely of 0xFF to the other slot, in order to make sure that the header of any previous image is overwritten and invalidated.

I believe I have seen cases where the slot not being flashed during
rescue still booted afterwards, meaning that the previous code flashing
and empty image to the other slot may be ineffective.  This PR changes
the default behavior to flashing an empty 4kB image on the other slot,
in order to make sure that the header of any previous image is
overwritten and invalidated.

Change-Id: I26b39f7eada4958f13fe1483fad60c53280d0cdc
Signed-off-by: Jes B. Klinke <[email protected]>
if self.slot == BootSlot::SlotB {
rescue.update_firmware(BootSlot::SlotA, &[])?;
rescue.update_firmware(BootSlot::SlotA, &vec![0xFF; 4096])?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you write 4k? flash pages are 2k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants