many: reconfigure piboot on gadget refreshes - #17026
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17026 +/- ##
==========================================
- Coverage 79.07% 79.06% -0.02%
==========================================
Files 1370 1378 +8
Lines 190982 191593 +611
Branches 2465 2465
==========================================
+ Hits 151028 151474 +446
- Misses 30864 30993 +129
- Partials 9090 9126 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Tue May 12 12:35:45 UTC 2026 Failures:Preparing:
Executing:
Restoring:
Skipped tests from snapd-testing-skipIf you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)
|
3032e69 to
59a7973
Compare
7369b51 to
f9a3207
Compare
| if err != nil { | ||
| return err | ||
| } | ||
| if env.Get("snapd_recovery_mode") == "run" && env.Get("kernel_status") != "try" { |
There was a problem hiding this comment.
Should we warn if we are in try? I do not think this code should be called then. We do need to mark the boot successful before we update the gadget.
There was a problem hiding this comment.
To me this part is confusing, why is it needed to remove tryboot.txt here? Isn't this done alredy in SetBootVars?
There was a problem hiding this comment.
You guys are right - this was copied by a mistake while making this from SetBootVars. This cleanup is unneccessary.
alfonsosanchezbeato
left a comment
There was a problem hiding this comment.
Thanks, question
| if err != nil { | ||
| return err | ||
| } | ||
| if env.Get("snapd_recovery_mode") == "run" && env.Get("kernel_status") != "try" { |
There was a problem hiding this comment.
To me this part is confusing, why is it needed to remove tryboot.txt here? Isn't this done alredy in SetBootVars?
alfonsosanchezbeato
left a comment
There was a problem hiding this comment.
LGTM, thanks
During pi-boot gadget updates, the
os_prefixvalue did not get preserved. This kind of update happens rarely in normal cases (the pi-boot structure must have it's edition changed), and even during normal refreshes, if the kernel is updated in the same transaction this does not happen (because kernel updates refreshes theos_prefixvalue, and kernel is always updated after gadget).This is not the case for remodelling, as we use a different update policy here. During remodelling we update all gadget structures except for MBR. That's why this behaviour is triggered every time on remodelling where we don't do single-reboot either, meaning we update the gadget isolated (update gadget, reboot), and this leaves
os_prefixempty, and the system unable to boot again.Currently remodelling is broken for raspberry pi's that use pi-boot, this implements the needed step to always reconfigure the pi-boot bootloader on gadget refreshes.