patina_boot: Add install_ram_disk helper#1496
Closed
kat-perez wants to merge 2 commits into
Closed
Conversation
Adds sdk/patina/src/uefi_protocol/ram_disk.rs implementing the FFI binding for EFI_RAM_DISK_PROTOCOL per UEFI 2.10 section 13.16. Exposes the Protocol struct, RegisterFn / UnregisterFn type aliases, and the four well-known RamDiskType GUIDs (virtual disk, virtual CD, persistent variants). Used by the SRE flow to install the recovery WIM as a virtual block device after reading it out of the NVMe boot partition into RAM. Adds two unit tests covering the protocol GUID against the UEFI-spec value and the distinctness of the four RamDiskType GUIDs. Closes OpenDevicePartnership#65.
Contributor
✅ QEMU Validation PassedAll QEMU validation jobs completed successfully.
Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/25569761337 Boot Time to EFI Shell
Dependencies
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
d9c454f to
adc19cd
Compare
Adds patina::uefi_protocol::ram_disk::install(boot_services, bytes) -> Result<DevicePathBuf>. Leaks bytes into a stable heap allocation, locates the UEFI RAM Disk Protocol, and registers the buffer as a virtual disk of type RAM_DISK_VIRTUAL_DISK_GUID. Returns the firmware-assigned device path as an owned DevicePathBuf, suitable for boot_from_device_path or similar consumers. The backing memory lives for the rest of the firmware's lifetime — there is no Drop impl that frees it. Callers may invoke the protocol's unregister to remove the device-path entry, but the memory itself stays leaked. Lives next to the EFI_RAM_DISK_PROTOCOL bindings rather than in any boot-specific crate so any consumer of patina can use it without taking a boot-orchestration dependency. Gated behind the unstable-device-path feature because the return type uses DevicePathBuf, which is itself behind that feature. Closes OpenDevicePartnership/odp-platform-common#67.
b9f859e to
b3f0dfe
Compare
5 tasks
Contributor
Author
|
Closing in favor of OpenDevicePartnership/patina-components#13, which moves the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
install_ram_disk(boot_services, bytes) -> Result<DevicePathBuf>topatina_boot::helpers. Leaksbytesinto a stable heap allocation, locates the UEFI RAM Disk Protocol, and registers the buffer as a virtual disk of typeRAM_DISK_VIRTUAL_DISK_GUID. Returns the firmware-assigned device path as an ownedDevicePathBuf, suitable forboot_from_device_pathor similar consumers.The backing memory lives for the rest of the firmware's lifetime — there is no
Dropimpl that frees it. Callers may invoke the protocol'sunregisterto remove the device-path entry, but the memory itself stays leaked.Closes OpenDevicePartnership/odp-platform-common#67.
How This Was Tested
cargo make allIntegration Instructions
Stacked on #1490 (RAM Disk protocol bindings). Merge #1490 first, then this rebases trivially onto
feature/patina-boot.