Skip to content

Conversation

@ayodejiige
Copy link
Contributor

@ayodejiige ayodejiige commented Oct 20, 2025

This pull request introduces a new BootStatePolicy trait to the bootloader library, allowing bootloader applications to do the following:

  1. Set a default boot state specific to their application
  2. Perform application specific validation on the current boot state. A valid boot state from the perspective of the slimloader library may not be valid for the application. For example, up to 7 slots are possible but a specific application may have only 2.

The trait is defined for the Config structure and not the Board structure since this policies are application specific and not platform dependent.

Copilot AI review requested due to automatic review settings October 20, 2025 18:30
@ayodejiige ayodejiige requested a review from a team as a code owner October 20, 2025 18:30
Copy link

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

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 DefaultBootState trait with a customizable default_state() method
  • Updates the Board trait to require Config types to implement DefaultBootState
  • 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.

Copilot AI review requested due to automatic review settings October 21, 2025 04:39
Copy link

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 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.

@Wassasin
Copy link
Contributor

/approve

@jerrysxie jerrysxie enabled auto-merge (squash) October 21, 2025 14:42
@jerrysxie jerrysxie merged commit 524afdd into OpenDevicePartnership:main Oct 21, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants