-
Notifications
You must be signed in to change notification settings - Fork 87
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
backend/bitbox02bootloader: allow fixing broken install #2711
Conversation
@Beerosagos for efficiency I already merged the BitBoxSwiss/bitbox02-api-go#93, exposing the two functions needed here. PTAL anyway and I can add fixes in a new PR should you find any issues there. |
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.
The 'Take me back' button could/should also be hidden if the install is broken, as the device would not be able to boot anyway.
Edit: on 2nd thought I'll skip this, as it's a bunch of code overhead and only works in this particular edge case - if any regular update is interrupted the button would still be shown as before, and we cannot fix this easily. While not great, clicking the button would still show "Invalid firmware" on the device and the user can fix it by installing again.
the PR LGTM! I only found a tiny nit in a comment (see BitBoxSwiss/bitbox02-api-go@c5e4f77#r1601100822). Probably it doesn't even worth fixing it.. |
@Beerosagos did you mean this? BitBoxSwiss/bitbox02-api-go#94 |
Yup! Thanks |
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.
tACK!
To disambiguate from the unsigned binary.
By using the newly added `ParseSignedFirmware()` util function.
Problem: a new device ships with the latest firmware monotonic version. User sees 'Install' because the device is erased (no firmware on it), but during first install of firmware, unplugs. Upon replug, the device will show 'Invalid firmware' and boot into bootloader again. Since the monotonic version of the firmware to be installed is the same as the version stored on the device, and the device is not erased (half of the firmware is on it), the user sees no button to upgrade/instll anymore. This commit fixes this by still showing the upgrade button if the versions are the same, but the device firmware hash does not match the expected firmware hash.
Rebased |
Problem: a new device ships with the latest firmware monotonic version. User
sees 'Install' because the device is erased (no firmware on it), but during
first install of firmware, unplugs. Upon replug, the device will show 'Invalid
firmware' and boot into bootloader again. Since the monotonic version of the
firmware to be installed is the same as the version stored on the device, and
the device is not erased (half of the firmware is on it), the user sees no
button to upgrade/instll anymore.
This commit fixes this by still showing the upgrade button if the versions are
the same, but the device firmware hash does not match the expected firmware
hash.
Replaces #2700 - @thisconnect suggested to use the firmware hash instead, which is a much nicher solution as it does not show the upgrade button to every user who enters the bootloader, just to the ones where the firmware install is actually broken - thanks @thisconnect 🙏