You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate patina_boot from direct StandardBootServices component dependencies to the granular Patina UEFI Services introduced by OpenDevicePartnership/patina#1743.
Why
Patina's major-branch component model removes StandardBootServices as a component parameter. Driver, event, image, protocol, timing, and TPL access are exposed as cohesive service traits with generated mockall mocks. Aligning with that model removes the need for a full raw UEFI boot-services table in host tests and makes the upstream API consistent with Patina's direction.
Scope
replace BootOrchestrator and BootDispatcher boot-service parameters with the required Patina UEFI service dependencies
map helper functions to driver, event, image, protocol, timing, and TPL service traits
use generated service mocks in host tests and benchmarks
The component entry point consumes the granular Patina services it needs:
Service<dyn ProtocolServices>
Service<dyn DriverServices>
Service<dyn EventServices>
Service<dyn ImageServices>
Service<dyn TimingServices>
Service<dyn DxeDispatch>
image Handle
Use ProtocolServices to publish the BDS architectural protocol. Bridge the injected services into the context-free BDS callback with the ServiceCell pattern introduced by Patina #1743 rather than exposing raw UEFI tables.
Runtime variables remain behind a crate-owned BootVariableStore trait. The initial adapter may use StandardRuntimeServices; replace it when Patina provides runtime-variable services.
BootOrchestrator owns policy, not firmware APIs
Do not pass six Patina services directly into BootOrchestrator. Give it a stable crate-owned domain context instead:
PreBootSession composes the Patina services through internal adapters and exposes domain operations such as device discovery, console setup, boot-option enumeration, and the security transition.
Enforce the security transition with typestate
let locked = session
.connect_and_dispatch()?
.discover_console()?
.enter_locked_boot()?;
locked.launch_selected_option(policy)?;
enter_locked_boot() must signal EndOfDxe and install ReadyToLock in order. It returns LockedBootSession only when both succeed. Only LockedBootSession exposes image load/start operations, making pre-lock image launch unrepresentable through the safe API.
Keep policy behind explicit traits
BootVariableStore: BootOrder, BootNext, BootCurrent, and load-option access
BootSourcePolicy: allowed devices, fallback behavior, and Secure Boot requirements
Parent roadmap: #190
Goal
Migrate
patina_bootfrom directStandardBootServicescomponent dependencies to the granular Patina UEFI Services introduced by OpenDevicePartnership/patina#1743.Why
Patina's major-branch component model removes
StandardBootServicesas a component parameter. Driver, event, image, protocol, timing, and TPL access are exposed as cohesive service traits with generatedmockallmocks. Aligning with that model removes the need for a full raw UEFI boot-services table in host tests and makes the upstream API consistent with Patina's direction.Scope
BootOrchestratorandBootDispatcherboot-service parameters with the required Patina UEFI service dependenciesAcceptance criteria
patina_bootno longer acceptsStandardBootServicesthrough its component-facing APIefi::BootServicestableDependencies
BootOrchestrator::execute()end-to-end (mocked) #124 and the upstream RFC re-proposal in Prepare the patina_boot upstream RFC re-proposal #200Proposed design
BootDispatcher is the Patina adapter
The component entry point consumes the granular Patina services it needs:
Service<dyn ProtocolServices>Service<dyn DriverServices>Service<dyn EventServices>Service<dyn ImageServices>Service<dyn TimingServices>Service<dyn DxeDispatch>HandleUse
ProtocolServicesto publish the BDS architectural protocol. Bridge the injected services into the context-free BDS callback with theServiceCellpattern introduced by Patina #1743 rather than exposing raw UEFI tables.Runtime variables remain behind a crate-owned
BootVariableStoretrait. The initial adapter may useStandardRuntimeServices; replace it when Patina provides runtime-variable services.BootOrchestrator owns policy, not firmware APIs
Do not pass six Patina services directly into
BootOrchestrator. Give it a stable crate-owned domain context instead:PreBootSessioncomposes the Patina services through internal adapters and exposes domain operations such as device discovery, console setup, boot-option enumeration, and the security transition.Enforce the security transition with typestate
enter_locked_boot()must signal EndOfDxe and install ReadyToLock in order. It returnsLockedBootSessiononly when both succeed. OnlyLockedBootSessionexposes image load/start operations, making pre-lock image launch unrepresentable through the safe API.Keep policy behind explicit traits
BootVariableStore:BootOrder,BootNext,BootCurrent, and load-option accessBootSourcePolicy: allowed devices, fallback behavior, and Secure Boot requirementsBootOptionResolver: semantic handling selected from Build a UEFI BDS semantic parity matrix for patina_boot #196ConnectPolicy: product-specific controller connection choicesThe default mechanism stays generic; Maa and OEM policy implementations live in consumer crates.
Test and benchmark layers
Mock*Servicestypes.SimpleBootManageragainst a mocked crate-owned boot session.This separates policy cost from Patina adapter cost and keeps API changes localized to
BootDispatcherand the adapter layer.