-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Description
Implement support for expanding partial device paths to full device paths during boot option processing.
Background
UEFI Boot#### variables can contain partial (short-form) device paths that specify only a portion of the full hardware path. For example, a hard drive boot option might contain only HD(1,GPT,<GUID>) without the preceding PCI path. These partial paths must be expanded by matching against the current device topology before they can be used for booting.
Requirements
- Detect partial vs full device paths by examining the first node type:
- Full paths: start with hardware/ACPI root nodes (
PciRoot,Acpi) - Partial paths: start with media nodes (
HD,CDROM), messaging nodes without root, or file paths
- Full paths: start with hardware/ACPI root nodes (
- Expand partial device paths to full device paths by matching against discovered device topology
- Support common partial path types:
- Hard drive media device paths (partition GUID/signature matching)
- File path-only device paths
- Short-form device paths
- Handle cases where partial path matches multiple devices (prioritization strategy)
Design
Provide two functions to support different use cases:
| Function | Use Case |
|---|---|
boot_from_device_path() |
Simple case: pass any device path and boot. Expansion happens transparently. |
expand_device_path() |
Advanced case: explicit control over expansion for caching, custom prioritization when multiple devices match, or pre-boot validation. |
Rationale: Providing both functions ensures the library remains composable and future-proof. Most platforms just call boot_from_device_path() and it works transparently. Platforms needing explicit control can call expand_device_path() directly.
// Simple: just boot, expansion handled internally
boot_from_device_path(&partial_path)?;
// Advanced: expand first for caching/custom logic, then boot
let full_path = expand_device_path(&partial_path)?;
boot_from_device_path(&full_path)?;Related
- RFC: Boot Orchestration (RFC: Boot Orchestration Component #1013)
- Task: BootOptionDiscovery component ([Task] patina_boot: Implement BootOptionDiscovery component #1226)
- PR: patina_boot crate ([feature/patina-boot] patina_boot: Add boot orchestration crate #1225)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status