-
Notifications
You must be signed in to change notification settings - Fork 11
Make default boot state user configurable #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make default boot state user configurable #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a configurable default boot state mechanism, allowing users to customize the initial state when no state is loaded from the journal. The change replaces the hardcoded default boot state with a trait-based approach.
- Introduces a
DefaultBootStatetrait with a customizabledefault_state()method - Updates the
Boardtrait to requireConfigtypes to implementDefaultBootState - Refactors the boot initialization logic to use the trait-provided default state
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libs/ec-slimloader/src/lib.rs | Defines the DefaultBootState trait and updates Board::Config to require it; refactors boot state initialization to use the trait method |
| libs/ec-slimloader-imxrt/src/lib.rs | Adds DefaultBootState trait bound to the Board implementation for IMXRT platforms |
| examples/rt685s/bootloader/src/main.rs | Implements DefaultBootState for the example configuration using default trait implementation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this 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 3 out of 3 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
/approve |
This pull request introduces a new
BootStatePolicytrait to the bootloader library, allowing bootloader applications to do the following:The trait is defined for the
Configstructure and not theBoardstructure since this policies are application specific and not platform dependent.