sim: Remove cfg on `verify_image`
Remove the final conditional compilation in the simulator. The
simulator is now always built the same way, and bases the tests it runs
on the capability queries made to the MCUboot code. This simplifies the
simulator code a bit, and, importantly, removes the ability to have
mismatches between the configuration as compiled into the MCUboot code
and how the simulator is compiled.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/src/image.rs b/sim/src/image.rs
index 3fa4553..b940b6e 100644
--- a/sim/src/image.rs
+++ b/sim/src/image.rs
@@ -850,19 +850,13 @@
}
}
-#[cfg(feature = "overwrite-only")]
-#[allow(unused_variables)]
-// overwrite-only doesn't employ trailer management
fn verify_trailer(flashmap: &SimFlashMap, slots: &[SlotInfo], slot: usize,
magic: Option<u8>, image_ok: Option<u8>,
copy_done: Option<u8>) -> bool {
- true
-}
+ if Caps::OverwriteUpgrade.present() {
+ return true;
+ }
-#[cfg(not(feature = "overwrite-only"))]
-fn verify_trailer(flashmap: &SimFlashMap, slots: &[SlotInfo], slot: usize,
- magic: Option<u8>, image_ok: Option<u8>,
- copy_done: Option<u8>) -> bool {
let offset = slots[slot].trailer_off;
let dev_id = slots[slot].dev_id;
let mut copy = vec![0u8; c::boot_magic_sz() + c::boot_max_align() * 2];