@@ -276,7 +276,7 @@ test-sim-self-update: wolfboot.bin FORCE
276276# then verifies the persisted header matches the signing tool's --header-only
277277# output byte-for-byte, and finally boots into the test-app which calls
278278# open_self/verify_integrity/verify_authenticity to simulate an external entity
279- # veriyfing the bootloader image
279+ # verifying the bootloader image
280280#
281281test-sim-self-header-verify : wolfboot.bin test-app/image_v1_signed.bin FORCE
282282 @echo " === Simulator Self-Header Verification Test ==="
@@ -301,7 +301,7 @@ test-sim-self-header-verify: wolfboot.bin test-app/image_v1_signed.bin FORCE
301301 @# Extract the persisted header that the self-update wrote
302302 $(Q ) dd if=internal_flash.dd bs=1 skip=$$(($(WOLFBOOT_PARTITION_SELF_HEADER_ADDRESS ) - $(ARCH_FLASH_OFFSET ) ) ) count=$$(($(WOLFBOOT_SECTOR_SIZE ) ) ) of=persisted_hdr.dd 2> /dev/null
303303 @# Verify persisted header matches the signing tool's --header-only output
304- $(Q ) cmp -n 256 persisted_hdr.dd wolfboot_v2_header.bin
304+ $(Q ) cmp -n $$( ( $( IMAGE_HEADER_SIZE ) ) ) persisted_hdr.dd wolfboot_v2_header.bin
305305 @# Reassemble flash with test-app in boot partition so the app runs after wolfboot
306306 $(Q ) dd if=/dev/zero bs=$$(($(WOLFBOOT_PARTITION_SIZE ) ) ) count=1 2> /dev/null | tr ' \000' ' \377' > update_part_empty.dd
307307 $(Q ) dd if=/dev/zero bs=$$(($(WOLFBOOT_PARTITION_SIZE ) ) ) count=1 2> /dev/null | tr ' \000' ' \377' > boot_with_app.dd
@@ -342,11 +342,11 @@ test-sim-self-header-ext-verify: wolfboot.bin test-app/image_v1_signed.bin FORCE
342342 @# Run simulator — triggers self-update, which persists the header to external flash
343343 $(Q ) ./wolfboot.elf get_version || true
344344 @# Confirm internal flash self-header location remains erased (header went to external only)
345- $(Q ) dd if=/dev/zero bs=256 count=1 2> /dev/null | tr ' \000' ' \377' > erased_256 .dd
346- $(Q ) dd if=internal_flash.dd bs=1 skip=$$(($(WOLFBOOT_PARTITION_SELF_HEADER_ADDRESS ) - $(ARCH_FLASH_OFFSET ) ) ) count=256 2> /dev/null | cmp -s erased_256 .dd - && echo " === Internal Self-Header location remains erased PASSED ==="
345+ $(Q ) dd if=/dev/zero bs=$$( ( $( IMAGE_HEADER_SIZE ) ) ) count=1 2> /dev/null | tr ' \000' ' \377' > erased_hdr .dd
346+ $(Q ) dd if=internal_flash.dd bs=1 skip=$$(($(WOLFBOOT_PARTITION_SELF_HEADER_ADDRESS ) - $(ARCH_FLASH_OFFSET ) ) ) count=$$( ( $( IMAGE_HEADER_SIZE ) ) ) 2> /dev/null | cmp -s erased_hdr .dd - && echo " === Internal Self-Header location remains erased PASSED ==="
347347 @# Extract persisted header from external flash and verify it matches the signed header
348348 $(Q ) dd if=external_flash.dd bs=1 skip=$(WOLFBOOT_PARTITION_SELF_HEADER_ADDRESS ) count=$$(($(WOLFBOOT_SECTOR_SIZE ) ) ) of=persisted_hdr.dd 2> /dev/null
349- $(Q ) cmp -n 256 persisted_hdr.dd wolfboot_v2_header.bin
349+ $(Q ) cmp -n $$( ( $( IMAGE_HEADER_SIZE ) ) ) persisted_hdr.dd wolfboot_v2_header.bin
350350 @# Reassemble flash with test-app in boot and the persisted external header
351351 $(Q ) dd if=/dev/zero bs=$$(($(WOLFBOOT_PARTITION_SIZE ) ) ) count=1 2> /dev/null | tr ' \000' ' \377' > update_part_empty.dd
352352 $(Q ) dd if=/dev/zero bs=$$(($(WOLFBOOT_PARTITION_SIZE ) ) ) count=1 2> /dev/null | tr ' \000' ' \377' > boot_with_app.dd
0 commit comments