Repository navigation
Refill boot tries before slot selection in U-Boot scripts - #5054
Conversation
When no slot had tries left, the boot scripts reset both counters to 3, stored the env and rebooted right away. On USB disks the write can sit in the drive's cache. U-Boot never flushes it and the RPi bootloader cuts USB power on reboot. The write is lost and the board loops forever. Refill the counters before the slot loop instead, so the board boots in the same pass. The branch after the loop now only stores the decremented counters and resets. This replaces the ODROID-N2 approach from #4832, which kept the store and reset. Fixes #4886
|
No actionable comments were generated in the recent review. ๐ โน๏ธ Recent review infoโ๏ธ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: ๐ Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. ๐ WalkthroughWalkthroughTen U-Boot scripts now check slot counters before slot selection. If no listed slot has tries remaining, each script resets both counters to 3 and adds missing A or B slots to ChangesBoot slot try recovery
Priority: โ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix ยท Severity of issue fixed: Medium Merge Risk: โช Minimal ยท up to The change allows exhausted boot slots to be retried without a recovery-only reboot. No actionable merge-blocking risk is established; normal checks and board validation remain appropriate. ๐ฅ Pre-merge checks | โ 5โ Passed checks (5 passed)
โจ Finishing Touches๐งช Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the boot order with care, Comment |
| if test -z "${BOOT_TRIES_LEFT}"; then | ||
| echo "No slot has tries left, resetting tries to 3" | ||
| setenv BOOT_A_LEFT 3 | ||
| setenv BOOT_B_LEFT 3 |
There was a problem hiding this comment.
Should we also reset BOOT_ORDER? ๐ค
If we can't boot, maybe try the previously marked bad again isn't the worst idea.
There was a problem hiding this comment.
Yeah, that's actually good idea, since the bad slots get removed by RAUC. Pushed in another commit.
RAUC removes a slot from BOOT_ORDER when it marks it bad. If the remaining slot then used up all its tries, the refill only retried that slot and never the other one. Append any missing slot to BOOT_ORDER when refilling, keeping the current order so the preferred slot is still tried first.
When no slot had tries left, the boot scripts reset both counters to 3, stored the env and rebooted right away. On USB disks the write can sit in the drive's cache. U-Boot never flushes it and the RPi bootloader cuts USB power on reboot. The write is lost and the board loops forever.
Refill the counters before the slot loop instead, so the board boots in the same pass. The branch after the loop now only stores the decremented counters and resets. This replaces the ODROID-N2 approach from #4832, which kept the store and reset.
Fixes #4886
Summary by CodeRabbit