Commit 61a540dd authored by David Brown's avatar David Brown Committed by David Brown
Browse files

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: default avatarDavid Brown <david.brown@linaro.org>
parent f38bc342
Loading
Loading
Loading
Loading
+2 −8
Changes for sim/src/image.rs: 2 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -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];