Skip to content

Commit

Permalink
Revert to hubtools 0.4.6, don't build with a default epoch value.
Browse files Browse the repository at this point in the history
Don't require updating to hubtools 0.4.7. There doesn't need to be
an 'EPOC' in the caboose as it is always "0" at this step in
the release engineering flow.

Fix complementary swapped args and corresponding swapped comparison to
read correctly.

Remove vestigial epoch header check. With the decision to not use
ImageHeader.epoch, a TBD prep_image_update variant will contain
the epoch information.
  • Loading branch information
lzrd committed Oct 16, 2024
1 parent 6f5d861 commit aca5140
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions drv/lpc55-update-server/src/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ impl From<&[u8]> for Epoch {

impl Epoch {
pub fn can_update_to(&self, next: Epoch) -> bool {
self.value >= next.value
self.value <= next.value
}
}

Expand All @@ -611,8 +611,8 @@ impl Epoch {
/// so that images can be rejected early, i.e. before any flash has
/// been altered.
pub fn check_rollback_policy(
next_image: ImageAccess<'_>,
active_image: ImageAccess<'_>,
next_image: ImageAccess<'_>,
complete: bool,
) -> Result<(), UpdateError> {
let next_epoch = get_image_epoch(&next_image)?;
Expand Down
8 changes: 0 additions & 8 deletions drv/lpc55-update-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,6 @@ impl idl::InOrderUpdateImpl for ServerImpl<'_> {
self.header_block = None;
return Err(e.into());
}
let active_image =
ImageAccess::new_flash(&self.flash, component, slot.other());
if let Err(e) =
check_rollback_policy(active_image, next_image, false)
{
self.header_block = None;
return Err(e.into());
}
} else {
// Block order is enforced above. If we're here then we have
// seen block zero already.
Expand Down

0 comments on commit aca5140

Please sign in to comment.