-
Notifications
You must be signed in to change notification settings - Fork 77
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
image erase: allow only when slot image is not backup/pending... #11
Conversation
a02aa0e
to
d456e7a
Compare
Can you look at this @ccollins476ad @carlescufi |
I think you should be returning |
It was possible to erase slot 1 while it stores confirmed image while ongoing test run - this is unwanted behavior which allow to even brick remote device accidentally. This patch add check for such case of test run etc. This also aligns condition required for erase command execution to similar as upload command requires. Signed-off-by: Andrzej Puzdrowski <[email protected]>
d456e7a
to
0b0d5a8
Compare
Changed. I think here: |
I think the second one actually makes a little sense semantically, because if there is no available slot it could be "no mem", but erasing "no mem" would be weirder, so makes more sense to say it cannot erase because of a bad state. |
@utzig merge? |
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.
lgtm
Closing CBOR containers on error situations before returning.
It was possible to erase slot 1 while it stores confirmed image
while ongoing test run - this is unwanted behavior which allow
to even brick remote device accidentally.
This patch add check for such case of test run etc.
This also aligns condition required for erase command
execution to similar as upload command requires.
Signed-off-by: Andrzej Puzdrowski [email protected]