mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-08-13 08:22:36 +01:00
* Detect pending OS update after marking the booted slot good Since #7006 Supervisor recovers an OS update that is installed but still pending a reboot by comparing rauc's primary boot slot with the booted one at load time. On GRUB-based systems (generic-x86-64, OVA, generic-aarch64) this misfires on every boot: grub.cfg increments the booted slot's boot attempt counter on each boot attempt, and rauc's GRUB backend only treats a slot as primary once it has no boot attempts pending. Until the booted slot is marked good -- which happens later in Core.start() -- GetPrimary reports the previous slot as primary, so Supervisor misdetected the previous slot's (older) version as a pending update. This raised a bogus reboot-required issue on every boot (#7016) and, since /os/info reports a pending version as the current version, made Core offer an "update" to the already running version, which Supervisor then rejected as already installed (#7017). Move the detection from load() into mark_healthy() and mark the booted slot good first: that resets the boot attempt counter, making GetPrimary trustworthy. Marking the booted slot active remains conditional on no pending update and now runs after the detection. * Log each rauc mark result where it happens Hardware testing of the RPi 5 tryboot counterpart surfaced that the combined log line in mark_healthy() reads like a routine healthy boot even when the OS backend just dropped a staged one-shot update inside the mark-good call, and its "activated slot" wording suggests a slot switch when the booted slot is merely re-asserted as primary. Log the result of each mark call right where it happens instead of accumulating the responses into a single line.