Add patina_ram_disk crate#13
Open
kat-perez wants to merge 1 commit into
Open
Conversation
5 tasks
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
4802a71 to
75dcf21
Compare
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 a new `patina_ram_disk` crate providing the `install` helper that publishes a byte buffer as a virtual block device via `EFI_RAM_DISK_PROTOCOL`.
The protocol binding itself (Protocol struct, GUIDs, RegisterFn/UnregisterFn) stays in `sdk/patina/uefi_protocol/ram_disk.rs` per patina#1490 — that's consistent with the existing decompress/performance_measurement/status_code conventions in sdk/patina. Only the `install` higher-level helper moves here, because it's a component-level operation that downstream consumers (e.g. `patina_sre` for SRE WIM publication) will pull in alongside other patina-components helpers.
This supersedes patina#1496, which added `install` to `sdk/patina::uefi_protocol::ram_disk`. The relocation mirrors the patina_nvme / patina_partition / patina_sre splits.
How This Was Tested
`cargo test --lib -p patina_ram_disk` — all 3 tests pass:
```
test tests::install_locate_failure ... ok
test tests::install_register_failure_propagates ... ok
test tests::install_forwards_base_and_size_to_register ... ok
```
The unsafe register-protocol dispatch is exercised with mock function pointers that capture base/size arguments and surface protocol-level errors as Rust `Err`s.
Integration Instructions
Consumers depend on `patina_ram_disk = "0.1"` from this repo. `patina` is currently pulled from the `kat-perez/issue-65-ramdisk-protocol-binding` branch since the binding it relies on isn't yet on crates.io — that dep moves to a versioned crates.io reference once patina#1490 merges and a patina release ships.
Closes #67 (SRE board) once patina#1496 is closed in favor of this PR.