mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-06-29 12:22:43 +00:00
b704298aa6
The boot script only persisted the decremented boot-attempt counter (storebootstate) when a kernel was successfully loaded. When *neither* slot's kernel could be loaded, it instead reset both counters back to 3 and rebooted - pinning them and looping forever without ever counting down or falling back. A failed kernel load therefore never consumed an attempt, defeating the A/B rollback safety net (#4788). Persist the (decremented) counters on a failed load too, and only re-arm them once both slots are actually exhausted instead of on every failure. Repeated load failures now count down and we fall back to the other slot. Note: this does not address the underlying eMMC read unreliability seen on some N2 units (kernel/boot.scr loads failing in U-Boot); it makes the slot-fallback logic behave correctly when a load does fail. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>