Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions uefi/crates/patina_sre/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
Cargo.lock
46 changes: 46 additions & 0 deletions uefi/crates/patina_sre/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Cargo manifest for the patina_sre crate.
#
# SPDX-License-Identifier: MIT
#

[package]
name = "patina_sre"
version = "0.1.0"
edition = "2024"
rust-version = "1.89"
license = "MIT"
repository = "https://github.com/OpenDevicePartnership/odp-platform-common"
homepage = "https://github.com/OpenDevicePartnership/odp-platform-common"
description = """
System Recovery Environment boot orchestrator. Implements
patina_boot::BootOrchestrator for platforms shipping an SRE alongside the main
OS — normal boot today; hotkey-to-SRE, WIM RAM-disk boot, and capsule pre-boot
hook land in follow-up issues.
"""
keywords = ["uefi", "patina", "firmware", "recovery", "sre"]
categories = ["embedded", "no-std"]
readme = "README.md"

[dependencies]
log = { version = "0.4", default-features = false }
r-efi = { version = "5", default-features = false }
spin = { version = "0.9", default-features = false, features = ["spin_mutex"] }

# patina_boot lives in OpenDevicePartnership/patina-components and is not yet
# published to crates.io. Pinning to main here; swap to a `version = ...` line
# once it publishes.
patina_boot = { git = "https://github.com/OpenDevicePartnership/patina-components", branch = "main" }

# Must match the patina that patina_boot itself uses, or trait/type identity
# breaks (two distinct `patina::DevicePathBuf` types, mismatched impls).
patina = { git = "https://github.com/OpenDevicePartnership/patina", branch = "feature/patina-boot", features = ["unstable-device-path"] }

[dev-dependencies]
patina = { git = "https://github.com/OpenDevicePartnership/patina", branch = "feature/patina-boot", features = ["mockall", "unstable-device-path"] }
mockall = { version = "0.13" }

[lints.clippy]
suspicious = "deny"
correctness = "deny"
perf = "deny"
style = "deny"
38 changes: 38 additions & 0 deletions uefi/crates/patina_sre/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# patina_sre

System Recovery Environment boot orchestrator for Patina firmware.

`SreBootManager` implements [`patina_boot::BootOrchestrator`] for platforms that
ship a System Recovery Environment alongside the main OS. The current crate is
a **skeleton** implementing the normal boot path only:

1. Interleave controller connection with DXE driver dispatch
2. Extra `connect_all` pass before EndOfDxe so platforms whose driver-binding
runs only in the open window get a chance to bind (e.g. `PartitionDxe`
creating GPT child handles)
3. Signal `EndOfDxe` (security lockdown)
4. Discover console devices
5. Write-lock the NVMe boot partition *(pending — TODO referencing
[odp-platform-common#61](https://github.com/OpenDevicePartnership/odp-platform-common/issues/61))*
6. Enumerate firmware `Boot####` EFI variables via `discover_boot_options`
and try each in order
7. Fall back to the constructor-provided `main_os_path` if discovery yields
nothing (or fails)

Follow-ups (tracked separately): Power+Vol-Up hotkey to enter SRE, SRE WIM
RAM-disk boot, capsule-update pre-boot hook.

## Use

```rust,ignore
use patina_boot::BootDispatcher;
use patina_sre::SreBootManager;

add.component(BootDispatcher::new(
SreBootManager::new(boot_partition_path, main_os_path),
));
```

## License

MIT
9 changes: 9 additions & 0 deletions uefi/crates/patina_sre/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Pinned Rust toolchain for patina_sre (UEFI targets).
#
# SPDX-License-Identifier: MIT
#

[toolchain]
channel = "nightly-2025-12-12"
targets = ["x86_64-unknown-uefi", "aarch64-unknown-uefi"]
components = ["rust-src", "clippy", "rustfmt"]
6 changes: 6 additions & 0 deletions uefi/crates/patina_sre/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# rustfmt configuration for the patina_sre crate.
#
# SPDX-License-Identifier: MIT
#

max_width = 120
Loading
Loading