-
Notifications
You must be signed in to change notification settings - Fork 740
RFC: boot: bootutil: Swap offset: Do not fail on header in wrong sector #2198
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
base: main
Are you sure you want to change the base?
RFC: boot: bootutil: Swap offset: Do not fail on header in wrong sector #2198
Conversation
Swap offset does not expect header in first sector/page of secondary slot, rather in secondary, and only attempts to swap an image that starts at second sector. This commit demotes condition when header is found in first page to just a warning and allows boot to proceed, as long as there is a header is second slot. Signed-off-by: Dominik Ermel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should delete it as it currently does because the what has been uploaded is invalid, no different than if you upload a corrupt image to a slot then mark it for upgrade
OK, but wouldn't it suffice to just remove the first page then? |
needs to clear first 2 sectors and trailer sector at least, in original implementation just used the existing clear image erase code that was already present in the file. Hmm do you mean like with #2199 ? |
So, in my case there was a sequence on the same board:
So why to clear two sectors? The header in the second sector is what I have expected
Yeah, maybe. But that had to be a lot of bad things happening for the magic to appear properly. But there is also a chance that some write started (can it?) during swap-offset, and there is already crap in the first sector, or something else managed to write there magic. |
Swap offset does not expect header in first sector/page of secondary slot, rather in secondary, and only attempts to swap an image that starts at second sector.
This commit demotes condition when header is found in first page to just a warning and allows boot to proceed, as long as there is a header is second slot.