fwmanager: Move HalBootControl into hal-adapters crate

Split the HAL-backed adapter out of fwmanager-api so the api crate is a
dependency-free leaf holding only the BootControl capability contract,
matching the layout of 9elements/openprot#20. HalBootControl and the
BootError wrapper move to the new fwmanager-hal-adapters crate, which
depends on //hal/blocking and the api crate.

Drop the system_control::Error bound from BootControl::Error, keeping
core::error::Error only: requiring the HAL error trait in the api crate
would keep the HAL dependency the split is meant to remove. BootError
still exposes kind(), and the generic-consumer test now recovers the
error category by downcasting the dyn core::error::Error instead of
relying on the removed bound.

Add impl From<E> for BootError<E> so implementations forwarding HAL
calls can use ? instead of .map_err(BootError), and switch
HalBootControl over to it.

Add api-side tests proving the contract stays implementable with no HAL
in sight, and cover the release error path in the adapter.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Christina Quast <christina.quast@9elements.com>
6 files changed
tree: 6930d6f0f9c7feb63153aafe14051f3374408117
  1. .github/
  2. docs/
  3. drivers/
  4. hal/
  5. openprot/
  6. platform/
  7. presubmit/
  8. services/
  9. target/
  10. third_party/
  11. tools/
  12. util/
  13. .bazelignore
  14. .bazelrc
  15. .bazelversion
  16. .clang-format
  17. .gitignore
  18. .semgrepignore
  19. BUILD.bazel
  20. CONTRIBUTING.md
  21. LICENSE
  22. MODULE.bazel
  23. MODULE.bazel.lock
  24. pw
  25. README.md
  26. rust-toolchain.toml
  27. workflows.json
README.md

OpenPRoT

Technical Charter

The OpenPRoT Technical Charter can be found at https://github.com/OpenPRoT/.github/blob/main/GOVERNANCE.md

Getting Started

NOTE: We are converting our build system to bazel. We recommend installing bazelisk to automatically manage bazel versions.

Available Tasks

You can run tasks using the Pigweed workflow launcher pw or bazel.

  • ./pw presubmit - Run presubmit checks: formatting, license checks, C/C++ header checks and clippy.
  • ./pw format - Run the code formatters.
  • bazel test //... - Run all tests.
  • bazel build //docs - Build documentation.

Development

The project is structured as a bazel module.

Requirements

  • Bazel. We recommend installing bazelisk to automatically manage bazel versions.

No additional tools are required - all dependencies are managed by bazel.