Skip to content

Add patina_ram_disk crate#13

Open
kat-perez wants to merge 1 commit into
OpenDevicePartnership:mainfrom
kat-perez:kat-perez/patina-ram-disk
Open

Add patina_ram_disk crate#13
kat-perez wants to merge 1 commit into
OpenDevicePartnership:mainfrom
kat-perez:kat-perez/patina-ram-disk

Conversation

@kat-perez
Copy link
Copy Markdown
Contributor

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.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

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.

@github-actions github-actions Bot added impact:testing Affects testing type:documentation Improvements or additions to documentation labels May 12, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.36620% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
patina_ram_disk/src/lib.rs 94.37% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:testing Affects testing type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants