Skip to content

Self update tweaks#711

Open
bigbrett wants to merge 7 commits intowolfSSL:masterfrom
bigbrett:self-update-tweaks
Open

Self update tweaks#711
bigbrett wants to merge 7 commits intowolfSSL:masterfrom
bigbrett:self-update-tweaks

Conversation

@bigbrett
Copy link
Contributor

@bigbrett bigbrett commented Mar 4, 2026

Additions

  • Monolithic self-update support: Adds new SELF_UPDATE_MONOLITHIC build option that allows a single payload to span the bootloader region into a contiguous boot partition, enabling both the bootloader and the boot application to be updated in one step. This feature is currently in use by a few customers so this new build option formalizes this "off-label" feature.
  • Skip boot verification option: New WOLFBOOT_SKIP_BOOT_VERIFY build option to skip integrity/authenticity checks on the boot image (added across all update backends). Intended as a performance optimization when used in conjunction with the self header and monolithic self-update features with an externally verifying entity (e.g. wolfHSM). Documented that this option is ONLY secure when used in this scenario with external verifying entity.
  • New AURIX config for monolithic updates
  • sim test case and documentation for monolithic self-update flow
  • doc updates

Notes

I was going to use this PR as an opportunity to formalize the memory region for the bootloader itself, which is currently inconsistently referenced or not referenced at all, depending on the platform (ARCH_FLASH_OFFSET, WOLFBOOT_ORIGIN, &_start_text, BOOTLOADER_PARTITION_SIZE, BOOTLOADER_SIZE, maybe there exists even more...). However in an effort to keep PRs small I'm punting that to a subsequent PR where I can refactor everything in one swoop. There may need to be some annoying steps taken for backwards compat and to ensure customer configurations aren't broken as well.

Copilot AI review requested due to automatic review settings March 4, 2026 20:07
@bigbrett bigbrett self-assigned this Mar 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds formal build-time support for “monolithic” self-updates (bootloader + boot app in one payload) and introduces an option to skip boot-image verification for performance in externally-verified deployments.

Changes:

  • Add SELF_UPDATE_MONOLITHIC build option and update erase behavior to cover the monolithic write range.
  • Add WOLFBOOT_SKIP_BOOT_VERIFY build option and gate boot-time integrity/authenticity checks across update backends.
  • Add simulator test target + example configs + documentation for the monolithic self-update flow.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tools/test.mk Adds a simulator test target for monolithic self-update flow.
src/update_ram.c Adds compile-time flag to skip boot-image verification in RAM update path.
src/update_flash_hwswap.c Adds compile-time flag to skip boot-image verification in HW-swap flash path.
src/update_flash.c Implements monolithic-aware erase length and skip-verify behavior in primary flash backend.
src/update_disk.c Adds compile-time flag to skip boot-image verification in disk backend.
options.mk Adds build flags for monolithic self-update and skipping boot verification.
docs/firmware_update.md Documents monolithic update payload construction + skip-verify option and warnings.
config/examples/sim-self-update-monolithic.config Adds simulator example config enabling monolithic self-update.
config/examples/aurix-tc375-hsm-monolithic-update-wolfHSM-certs-rsa4096.config Adds AURIX example config enabling monolithic self-update with wolfHSM.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@bigbrett bigbrett closed this Mar 4, 2026
@bigbrett bigbrett reopened this Mar 4, 2026
@bigbrett bigbrett marked this pull request as ready for review March 4, 2026 23:45
Copilot AI review requested due to automatic review settings March 4, 2026 23:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

erases the bootloader region and writes in-place. An interruption
during the write leaves the device unbootable.

- **Not revertable.** There is no swap or rollback mechanism. The old
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace 'revertable' with 'reversible' (or 'revertible') for correct spelling.

Suggested change
- **Not revertable.** There is no swap or rollback mechanism. The old
- **Not reversible.** There is no swap or rollback mechanism. The old

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants