mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-08-14 09:13:45 +01:00
The RAUC custom bootloader backend for the Raspberry Pi 5 firmware tryboot mechanism reported the committed boot slot (rauc.slot in cmdline.txt) as primary even while an installed update was staged for tryboot. Since Supervisor recovers an installed-but-not-yet-activated OS update by comparing RAUC's primary boot slot with the booted one (home-assistant/supervisor#7006, home-assistant/supervisor#7022), such updates were invisible to it on RPi 5 once Supervisor restarted in the window between install and activation reboot. Report the staged slot as primary as long as the tryboot reboot is armed (/run/systemd/reboot-param). Since /run is volatile and the firmware attempts a tryboot exactly once, a staged tryboot found without an armed reboot parameter has missed its attempt (power cut before the activation reboot, or the tryboot failed and the firmware fell back to the default slot): drop the staged files and mark the staged slot bad instead of leaving them around forever. Marking the committed slot active (or the staged slot bad) now also cancels a staged tryboot, matching the GRUB and U-Boot backend semantics. Also fix committing the tryboot state: the firmware's tryboot flag stays set for the entire boot, so the existence of cmdline-tryboot.txt cannot indicate a pending commit. Installing an update in the same boot the system tryboot'ed into (routine for back-to-back updates) made every subsequent mark-good fail with "tryboot doesn't reflect the expected boot slot". Commit only when the booted slot is not the default boot slot yet. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>