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>
This commit is contained in:
parent
f38bc342f9
commit
61a540dd4e
|
@ -850,19 +850,13 @@ fn verify_image(flashmap: &SimFlashMap, slots: &[SlotInfo], slot: usize,
|
|||
}
|
||||
}
|
||||
|
||||
#[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];
|
||||
|
|
Loading…
Reference in New Issue