Skip to content

Commit

Permalink
fix(src/rauc.rs): Use currently booted slot version as backup (if any)
Browse files Browse the repository at this point in the history
Instead of only using the version of the primary slot (which may not be
the currently booted), use the one of the currently booted, even if it
is not the primary.
This allows for proper version comparison and does not lead to scenarios
in which the current slot's version is being ignored (and the system is
potentially upgraded)

Signed-off-by: David Runge <[email protected]>
  • Loading branch information
dvzrv committed Sep 11, 2023
1 parent 7412e41 commit 910f5e5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/rauc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,13 @@ impl RaucInfo {
let slot_primary = slot_name == primary;

// if this slot is the primary and has a version, expose it as the system version
if slot_primary && slot_version.is_some() {
system_version = slot_version.clone();
}
system_version = if (slot_primary && slot_version.is_some())
|| (slot_name == boot_slot && slot_version.is_some())
{
slot_version.clone()
} else {
None
};

slots.push(Slot::new(
slot_primary,
Expand Down

0 comments on commit 910f5e5

Please sign in to comment.