Lines Matching +full:if +full:- +full:no +full:- +full:files +full:- +full:found
1 // Copyright (c) 2019-2021 Linaro LTD
2 // Copyright (c) 2019-2020 JUUL Labs
3 // Copyright (c) 2019-2023 Arm Limited
5 // SPDX-License-Identifier: Apache-2.0
57 /// For testing, use a non-zero offset for the ram-load, to make sure the offset is getting used
83 /// When doing multi-image, there is an instance of this information for
91 /// The Rust-side representation of an image. For unencrypted images, this
101 /// multi-image builds, these may not correspond with the offsets. This has to be computed early,
138 /// Some(builder) if is possible to test this configuration, or None if
139 /// not possible (for example, if there aren't enough image slots).
140 pub fn new(device: DeviceName, align: usize, erased_val: u8) -> Result<Self, String> { in new()
144 if cap.present() { in new()
179 trailer_off: primary_base + primary_len - offset_from_end, in new()
188 trailer_off: secondary_base + secondary_len - offset_from_end, in new()
223 …pub fn make_no_upgrade_image(self, deps: &DepTest, img_manipulation: ImageManipulation) -> Images { in make_no_upgrade_image()
229 let dep: Box<dyn Depender> = if num_images > 1 { in make_no_upgrade_image()
235 …let (primaries,upgrades) = if img_manipulation == ImageManipulation::CorruptHigherVersionImage &&… in make_no_upgrade_image()
270 pub fn make_image(self, deps: &DepTest, permanent: bool) -> Images { in make_image()
276 // The count is meaningless if no flash operations are performed. in make_image()
277 if !Caps::modifies_flash() { in make_image()
285 if deps.upgrades.iter().any(|u| *u == UpgradeInfo::Held) { in make_image()
296 pub fn make_bad_secondary_slot_image(self) -> Images { in make_bad_secondary_slot_image()
319 pub fn make_oversized_secondary_slot_image(self) -> Images { in make_oversized_secondary_slot_image()
342 pub fn make_erased_secondary_image(self) -> Images { in make_erased_secondary_image()
364 pub fn make_bootstrap_image(self) -> Images { in make_bootstrap_image()
386 pub fn make_oversized_bootstrap_image(self) -> Images { in make_oversized_bootstrap_image()
408 …/// If security_cnt is None then do not add a security counter TLV, otherwise add the specified va…
409 pub fn make_image_with_security_counter(self, security_cnt: Option<u32>) -> Images { in make_image_with_security_counter()
433 …pub fn make_device(device: DeviceName, align: usize, erased_val: u8) -> (SimMultiFlash, Rc<AreaDes… in make_device()
555 pub fn num_images(&self) -> usize { in num_images()
564 /// inject failures at chosen steps. Returns None if it was unable to
566 pub fn run_basic_upgrade(&self, permanent: bool) -> Option<i32> { in run_basic_upgrade()
570 if !self.verify_images(&flash, 0, 1) { in run_basic_upgrade()
578 pub fn run_bootstrap(&self) -> bool { in run_bootstrap()
582 if Caps::Bootstrap.present() { in run_bootstrap()
585 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_bootstrap()
590 if !self.verify_images(&flash, 0, 1) { in run_bootstrap()
595 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_bootstrap()
602 if fails > 0 { in run_bootstrap()
609 pub fn run_oversized_bootstrap(&self) -> bool { in run_oversized_bootstrap()
613 if Caps::Bootstrap.present() { in run_oversized_bootstrap()
618 if boot_result { in run_oversized_bootstrap()
623 if self.verify_images(&flash, 0, 1) { in run_oversized_bootstrap()
628 if self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_oversized_bootstrap()
635 if fails > 0 { in run_oversized_bootstrap()
645 pub fn run_check_deps(&self, deps: &DepTest) -> bool { in run_check_deps()
646 if !Caps::modifies_flash() { in run_check_deps()
655 fn is_swap_upgrade(&self) -> bool { in is_swap_upgrade()
659 pub fn run_basic_revert(&self) -> bool { in run_basic_revert()
660 if Caps::OverwriteUpgrade.present() || !Caps::modifies_flash() { in run_basic_revert()
666 // FIXME: this test would also pass if no swap is ever performed??? in run_basic_revert()
667 if self.is_swap_upgrade() { in run_basic_revert()
671 if !self.verify_images(&flash, 0, 0) { in run_basic_revert()
681 pub fn run_perm_with_fails(&self) -> bool { in run_perm_with_fails()
682 if !Caps::modifies_flash() { in run_perm_with_fails()
689 if skip_slow_test() { in run_perm_with_fails()
698 if !self.verify_images(&flash, 0, 1) { in run_perm_with_fails()
703 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_perm_with_fails()
709 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in run_perm_with_fails()
715 if self.is_swap_upgrade() && !self.verify_images(&flash, 1, 0) { in run_perm_with_fails()
722 if fails > 0 { in run_perm_with_fails()
730 pub fn run_perm_with_random_fails(&self, total_fails: usize) -> bool { in run_perm_with_random_fails()
731 if !Caps::modifies_flash() { in run_perm_with_random_fails()
741 let secondary_slot_ok = if self.is_swap_upgrade() { in run_perm_with_random_fails()
747 if !primary_slot_ok || !secondary_slot_ok { in run_perm_with_random_fails()
750 if primary_slot_ok { "ok" } else { "fail" }, in run_perm_with_random_fails()
751 if secondary_slot_ok { "ok" } else { "fail" }); in run_perm_with_random_fails()
754 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_perm_with_random_fails()
759 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in run_perm_with_random_fails()
765 if fails > 0 { in run_perm_with_random_fails()
772 pub fn run_revert_with_fails(&self) -> bool { in run_revert_with_fails()
773 if Caps::OverwriteUpgrade.present() || !Caps::modifies_flash() { in run_revert_with_fails()
779 if skip_slow_test() { in run_revert_with_fails()
783 if self.is_swap_upgrade() { in run_revert_with_fails()
786 if self.try_revert_with_fail_at(i) { in run_revert_with_fails()
796 pub fn run_norevert(&self) -> bool { in run_norevert()
797 if Caps::OverwriteUpgrade.present() || !Caps::modifies_flash() { in run_norevert()
807 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_norevert()
812 //FIXME: copy_done is written by boot_go, is it ok if no copy in run_norevert()
815 if !self.verify_images(&flash, 0, 1) { in run_norevert()
819 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_norevert()
824 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in run_norevert()
831 // no revert should happen... in run_norevert()
834 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_norevert()
840 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_norevert()
845 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_norevert()
850 if !self.verify_images(&flash, 0, 1) { in run_norevert()
855 if fails > 0 { in run_norevert()
863 pub fn run_oversizefail_upgrade(&self) -> bool { in run_oversizefail_upgrade()
869 // Only perform this test if an upgrade is expected to happen. in run_oversizefail_upgrade()
870 if !Caps::modifies_flash() { in run_oversizefail_upgrade()
879 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_oversizefail_upgrade()
886 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_oversizefail_upgrade()
892 if !self.verify_images(&flash, 0, 0) { in run_oversizefail_upgrade()
896 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_oversizefail_upgrade()
902 if fails > 0 { in run_oversizefail_upgrade()
911 pub fn run_nodowngrade(&self) -> bool { in run_nodowngrade()
912 if !Caps::DowngradePrevention.present() { in run_nodowngrade()
919 info!("Try no downgrade"); in run_nodowngrade()
922 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_nodowngrade()
927 if !self.verify_images(&flash, 0, 0) { in run_nodowngrade()
932 if fails > 0 { in run_nodowngrade()
940 // image_ok set while there is no image on the secondary slot, so no revert
942 pub fn run_norevert_newimage(&self) -> bool { in run_norevert_newimage()
943 if !Caps::modifies_flash() { in run_norevert_newimage()
951 info!("Try non-revert on imgtool generated image"); in run_norevert_newimage()
957 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_norevert_newimage()
964 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_norevert_newimage()
970 if !self.verify_images(&flash, 0, 0) { in run_norevert_newimage()
974 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_norevert_newimage()
979 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in run_norevert_newimage()
985 if fails > 0 { in run_norevert_newimage()
993 // image_ok set while there is no image on the secondary slot, so no revert
995 pub fn run_signfail_upgrade(&self) -> bool { in run_signfail_upgrade()
1001 // Only perform this test if an upgrade is expected to happen. in run_signfail_upgrade()
1002 if !Caps::modifies_flash() { in run_signfail_upgrade()
1011 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_signfail_upgrade()
1018 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_signfail_upgrade()
1024 if !self.verify_images(&flash, 0, 0) { in run_signfail_upgrade()
1028 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_signfail_upgrade()
1034 if fails > 0 { in run_signfail_upgrade()
1043 pub fn run_secondary_leftover_trailer(&self) -> bool { in run_secondary_leftover_trailer()
1044 if !Caps::modifies_flash() { in run_secondary_leftover_trailer()
1058 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_secondary_leftover_trailer()
1064 if !self.verify_images(&flash, 0, 0) { in run_secondary_leftover_trailer()
1068 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in run_secondary_leftover_trailer()
1074 if fails > 0 { in run_secondary_leftover_trailer()
1081 fn trailer_sz(&self, align: usize) -> usize { in trailer_sz()
1085 fn status_sz(&self, align: usize) -> usize { in status_sz()
1089 /// This test runs a simple upgrade with no fails in the images, but
1092 pub fn run_with_status_fails_complete(&self) -> bool { in run_with_status_fails_complete()
1093 if !Caps::ValidatePrimarySlot.present() || !Caps::modifies_flash() { in run_with_status_fails_complete()
1106 if !result.success() { in run_with_status_fails_complete()
1113 if result.asserts() != 0 { in run_with_status_fails_complete()
1118 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in run_with_status_fails_complete()
1124 if !self.verify_images(&flash, 0, 1) { in run_with_status_fails_complete()
1130 re-run of boot_go should just work"); in run_with_status_fails_complete()
1131 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in run_with_status_fails_complete()
1136 if fails > 0 { in run_with_status_fails_complete()
1143 /// This test runs a simple upgrade with no fails in the images, but
1146 pub fn run_with_status_fails_with_reset(&self) -> bool { in run_with_status_fails_with_reset()
1147 if Caps::OverwriteUpgrade.present() || !Caps::modifies_flash() { in run_with_status_fails_with_reset()
1149 } else if Caps::ValidatePrimarySlot.present() { in run_with_status_fails_with_reset()
1165 if asserts != 0 { in run_with_status_fails_with_reset()
1176 // This might throw no asserts, for large sector devices, where in run_with_status_fails_with_reset()
1177 // a single failure writing is indistinguishable from no failure, in run_with_status_fails_with_reset()
1180 if asserts > 1 { in run_with_status_fails_with_reset()
1186 if fails > 0 { in run_with_status_fails_with_reset()
1203 if asserts == 0 { in run_with_status_fails_with_reset()
1204 warn!("No assert() detected"); in run_with_status_fails_with_reset()
1214 pub fn run_direct_xip(&self) -> bool { in run_direct_xip()
1215 if !Caps::DirectXip.present() { in run_direct_xip()
1219 // Clone the flash so we can tell if unchanged. in run_direct_xip()
1225 let resp = if let Some(resp) = result.resp() { in run_direct_xip()
1232 if let Some((offset, _, dev_id)) = self.areadesc.find(FlashId::Image1) { in run_direct_xip()
1241 /// Test the ram-loading.
1242 pub fn run_ram_load(&self) -> bool { in run_ram_load()
1243 if !Caps::RamLoad.present() { in run_ram_load()
1247 // Clone the flash so we can tell if unchanged. in run_ram_load()
1251 let ram = RamBlock::new(self.ram.total - RAM_LOAD_ADDR, RAM_LOAD_ADDR); in run_ram_load()
1258 if !result.success() { in run_ram_load()
1259 error!("Failed to execute ram-load"); in run_ram_load()
1266 let ram_image = ram.borrow_part(place.offset as usize - RAM_LOAD_ADDR as usize, in run_ram_load()
1269 if src_sz > ram_image.len() { in run_ram_load()
1275 if ram_image != src_image { in run_ram_load()
1285 /// Test the split ram-loading.
1286 pub fn run_split_ram_load(&self) -> bool { in run_split_ram_load()
1287 if !Caps::RamLoad.present() { in run_split_ram_load()
1291 // Clone the flash so we can tell if unchanged. in run_split_ram_load()
1295 let ram = RamBlock::new(self.ram.total - RAM_LOAD_ADDR, RAM_LOAD_ADDR); in run_split_ram_load()
1301 if !result.success() { in run_split_ram_load()
1302 error!("Failed to execute ram-load"); in run_split_ram_load()
1310 let ram_image = ram.borrow_part(place.offset as usize - RAM_LOAD_ADDR as usize, in run_split_ram_load()
1313 if src_sz > ram_image.len() { in run_split_ram_load()
1319 if ram_image != src_image { in run_split_ram_load()
1329 pub fn run_hw_rollback_prot(&self) -> bool { in run_hw_rollback_prot()
1330 if !Caps::HwRollbackProtection.present() { in run_hw_rollback_prot()
1341 if result.success() { in run_hw_rollback_prot()
1346 if counter_val != 30 { in run_hw_rollback_prot()
1354 pub fn run_ram_load_boot_with_result(&self, expected_result: bool) -> bool { in run_ram_load_boot_with_result()
1355 if !Caps::RamLoad.present() { in run_ram_load_boot_with_result()
1358 // Clone the flash so we can tell if unchanged. in run_ram_load_boot_with_result()
1362 let ram = RamBlock::new(self.ram.total - RAM_LOAD_ADDR, RAM_LOAD_ADDR); in run_ram_load_boot_with_result()
1368 if result.success() != expected_result { in run_ram_load_boot_with_result()
1379 if Caps::OverwriteUpgrade.present() { in mark_bad_status_with_rate()
1390 let status_off = off + len - self.trailer_sz(align); in mark_bad_status_with_rate()
1398 if !Caps::ValidatePrimarySlot.present() { in reset_bad_status()
1415 fn try_upgrade(&self, stop: Option<i32>, permanent: bool) -> (SimMultiFlash, i32) { in try_upgrade()
1419 if permanent { in try_upgrade()
1429 x if x.interrupted() => (true, stop.unwrap()), in try_upgrade()
1430 x if x.success() => (false, -counter), in try_upgrade()
1435 if first_interrupted { in try_upgrade()
1439 x if x.interrupted() => panic!("Shouldn't stop again"), in try_upgrade()
1440 x if x.success() => (), in try_upgrade()
1445 (flash, count - counter) in try_upgrade()
1448 fn try_revert(&self, count: usize) -> SimMultiFlash { in try_revert()
1459 fn try_revert_with_fail_at(&self, stop: i32) -> bool { in try_revert_with_fail_at()
1464 if !c::boot_go(&mut flash, &self.areadesc, Some(&mut counter), None, in try_revert_with_fail_at()
1470 // In a multi-image setup, copy done might be set if any number of in try_revert_with_fail_at()
1472 if !self.verify_trailers_loose(&flash, 0, None, None, BOOT_FLAG_UNSET) { in try_revert_with_fail_at()
1477 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in try_revert_with_fail_at()
1482 if !self.verify_images(&flash, 0, 1) { in try_revert_with_fail_at()
1487 if !self.verify_images(&flash, 1, 0) { in try_revert_with_fail_at()
1492 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in try_revert_with_fail_at()
1497 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in try_revert_with_fail_at()
1505 if !c::boot_go(&mut flash, &self.areadesc, Some(&mut counter), None, in try_revert_with_fail_at()
1511 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in try_revert_with_fail_at()
1516 if !self.verify_images(&flash, 0, 0) { in try_revert_with_fail_at()
1521 if !self.verify_images(&flash, 1, 1) { in try_revert_with_fail_at()
1527 if !self.verify_trailers(&flash, 0, BOOT_MAGIC_GOOD, in try_revert_with_fail_at()
1532 if !self.verify_trailers(&flash, 1, BOOT_MAGIC_UNSET, in try_revert_with_fail_at()
1538 if !c::boot_go(&mut flash, &self.areadesc, None, None, false).success() { in try_revert_with_fail_at()
1543 if !self.verify_images(&flash, 0, 0) { in try_revert_with_fail_at()
1547 if !self.verify_images(&flash, 1, 1) { in try_revert_with_fail_at()
1556 fn try_random_fails(&self, total_ops: i32, count: usize) -> (SimMultiFlash, Vec<i32>) { in try_random_fails()
1569 x if x.interrupted() => (), in try_random_fails()
1572 remaining_ops -= reset_counter; in try_random_fails()
1577 x if x.interrupted() => panic!("Should not be have been interrupted!"), in try_random_fails()
1578 x if x.success() => (), in try_random_fails()
1587 fn verify_images(&self, flash: &SimMultiFlash, slot: usize, against: usize) -> bool { in verify_images()
1599 fn verify_dep_images(&self, flash: &SimMultiFlash, deps: &DepTest) -> bool { in verify_dep_images()
1602 if !verify_image(flash, &image.slots[0], in verify_dep_images()
1619 copy_done: Option<u8>) -> bool { in verify_trailers_loose()
1630 copy_done: Option<u8>) -> bool { in verify_trailers()
1651 /// Dump out the flash image(s) to one or more files for debugging
1653 /// "{prefix}-001.mcubin" depending on how many images there are.
1656 let name = if self.flash.len() == 1 { in debug_dump()
1659 format!("{}-{:>0}.mcubin", prefix, id) in debug_dump()
1669 fn new(slots: &[[SlotInfo; 2]]) -> RamData { in new()
1672 // println!("Setup:-------------");
1692 /// Lookup the ram data associated with a given flash partition. We just panic if not present,
1694 fn lookup(&self, slot: &SlotInfo) -> &SlotPlace { in lookup()
1703 println!("---- Flash configuration ----"); in show_flash()
1721 #[cfg(not(feature = "max-align-32"))]
1722 fn tralier_estimation(dev: &dyn Flash) -> usize { in tralier_estimation()
1726 #[cfg(feature = "max-align-32")]
1727 fn tralier_estimation(dev: &dyn Flash) -> usize { in tralier_estimation()
1734 fn image_largest_trailer(dev: &dyn Flash) -> usize { in image_largest_trailer()
1737 let trailer = if Caps::OverwriteUpgrade.present() { in image_largest_trailer()
1741 } else if Caps::SwapUsingMove.present() { in image_largest_trailer()
1744 } else if Caps::SwapUsingScratch.present() { in image_largest_trailer()
1757 …s: &dyn Depender, img_manipulation: ImageManipulation, security_counter:Option<u32>) -> ImageData { in install_image()
1764 if img_manipulation == ImageManipulation::IgnoreRamLoadFlag { in install_image()
1778 let load_addr = if Caps::RamLoad.present() { in install_image()
1782 ImageManipulation::OverlapImages(false) => place.offset - 1, in install_image()
1796 slot_len - HDR_SIZE - trailer - tlv_len in install_image()
1804 // configurations. It might be precise if tlv_len will be maked precise. in install_image()
1805 slot_len - HDR_SIZE - trailer - tlv_len + dev.align()*4 in install_image()
1833 // to see what it is. This will fail if the image itself is too small. in install_image()
1848 if is_encrypted { in install_image()
1855 if aes256 { in install_image()
1869 if img_manipulation == ImageManipulation::BadSignature { in install_image()
1887 if is_encrypted { in install_image()
1897 // Since images are always non-encrypted in the primary slot, we first write in install_image()
1898 // an encrypted image, re-read to use for verification, erase + flash in install_image()
1899 // un-encrypted. In the secondary slot the image is written un-encrypted, in install_image()
1900 // and if encryption is requested, it follows an erase + flash encrypted. in install_image()
1902 // In the case of ram-load when encryption is enabled both slots have to in install_image()
1905 if slot.index == 0 && !Caps::RamLoad.present() { in install_image()
1908 if is_encrypted { in install_image()
1940 if is_encrypted { in install_image()
1961 /// Install no image. This is used when no upgrade happens.
1962 fn install_no_image() -> ImageData { in install_no_image()
1972 fn make_tlv() -> TlvGen { in make_tlv()
1973 let aes_key_size = if Caps::Aes256.present() { 256 } else { 128 }; in make_tlv()
1975 if Caps::EncKw.present() { in make_tlv()
1976 if Caps::RSA2048.present() { in make_tlv()
1978 } else if Caps::EcdsaP256.present() { in make_tlv()
1983 } else if Caps::EncRsa.present() { in make_tlv()
1984 if Caps::RSA2048.present() { in make_tlv()
1989 } else if Caps::EncEc256.present() { in make_tlv()
1990 if Caps::EcdsaP256.present() { in make_tlv()
1995 } else if Caps::EncX25519.present() { in make_tlv()
1996 if Caps::Ed25519.present() { in make_tlv()
2002 // The non-encrypted configuration. in make_tlv()
2003 if Caps::RSA2048.present() { in make_tlv()
2005 } else if Caps::RSA3072.present() { in make_tlv()
2007 } else if Caps::EcdsaP256.present() || Caps::EcdsaP384.present() { in make_tlv()
2009 } else if Caps::Ed25519.present() { in make_tlv()
2011 } else if Caps::HwRollbackProtection.present() { in make_tlv()
2022 fn find(&self, slot: usize) -> &Vec<u8> { in find()
2033 fn size(&self) -> usize { in size()
2039 fn verify_image(flash: &SimMultiFlash, slot: &SlotInfo, images: &ImageData) -> bool { in verify_image()
2049 if buf != ©[..] { in verify_image()
2051 if buf[i] != copy[i] { in verify_image()
2065 copy_done: Option<u8>) -> bool { in verify_trailer()
2066 if Caps::OverwriteUpgrade.present() { in verify_trailer()
2081 let magic_off = (c::boot_max_align() * 3) + (c::boot_magic_sz() - MAGIC.len()); in verify_trailer()
2082 if v == 1 && ©[magic_off..] != MAGIC { in verify_trailer()
2085 } else if v == 3 { in verify_trailer()
2087 if copy[magic_off..] != expected { in verify_trailer()
2103 if (v == 1 && copy[image_ok_off] != v) || (v == 3 && copy[image_ok_off] != erased_val) { in verify_trailer()
2116 … if (v == 1 && copy[copy_done_off] != v) || (v == 3 && copy[copy_done_off] != erased_val) { in verify_trailer()
2135 // If there are any partitions in this device that start at 0, and in install_ptable()
2146 if skip_ptable { in install_ptable()
2147 if log_enabled!(Info) { in install_ptable()
2218 #[cfg(not(feature = "max-align-32"))]
2224 #[cfg(feature = "max-align-32")]
2230 // Replicates defines found in bootutil.h
2242 if offset % align != 0 || MAGIC.len() % align != 0 { in mark_upgrade()
2247 let magic_off = (offset % align) + (c::boot_magic_sz() - MAGIC.len()); in mark_upgrade()
2249 dev.write(offset - (offset % align), &buf).unwrap(); in mark_upgrade()
2256 /// the this image is ok (not a test, and no revert is to be performed).
2261 if Caps::OverwriteUpgrade.present() { in mark_permanent_upgrade()
2273 // Drop some pseudo-random gibberish onto the data.
2285 /// Return a read-only view into the raw bytes of this object
2287 fn as_raw(&self) -> &[u8] { in as_raw()
2293 /// Determine whether it makes sense to test this configuration with a maximally-sized image.
2295 fn maximal(size: usize) -> ImageSize { in maximal()
2296 if Caps::OverwriteUpgrade.present() || in maximal()
2313 #[cfg(not(feature = "max-align-32"))]
2314 fn test_alignments() -> &'static [usize] { in test_alignments()
2318 #[cfg(feature = "max-align-32")]
2319 fn test_alignments() -> &'static [usize] { in test_alignments()
2326 fn skip_slow_test() -> bool { in skip_slow_test()
2327 if let Ok(_) = std::env::var("MCUBOOT_SKIP_SLOW_TESTS") { in skip_slow_test()