Files
supervisor/tests/os
Stefan AgnerandGitHub 7678f7bd2f Detect pending OS update after marking the booted slot good (#7022)
* 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.
2026-07-10 18:48:29 +02:00
..
2021-09-17 15:01:07 +02:00