Add patina_partition crate#12
Open
kat-perez wants to merge 1 commit into
Open
Conversation
This was referenced May 12, 2026
Closed
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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_partition` crate exposing generic UEFI partition I/O helpers, split by protocol:
Both helpers were previously inside `patina_boot` (via patina#1489 "partition raw-write" and patina#1495 "partition file-read"). Reviewer feedback on patina#1488 made the case that storage abstractions don't belong in the boot crate; this PR is the relocation, mirroring the existing patina-components#11 (`patina_nvme`) split.
How This Was Tested
`cargo test --lib -p patina_partition` — all 11 tests pass:
```
test block_io::tests::test_write_partition_raw_empty_data_is_noop ... ok
test block_io::tests::test_write_partition_raw_locate_failure ... ok
test block_io::tests::test_write_partition_raw_handle_protocol_failure ... ok
test block_io::tests::test_write_partition_raw_inner_writes_to_lba_zero_with_aligned_size ... ok
test block_io::tests::test_write_partition_raw_inner_read_only_rejected ... ok
test block_io::tests::test_write_partition_raw_inner_writeblocks_failure_propagates ... ok
test file_system::tests::test_read_partition_file_locate_failure ... ok
test file_system::tests::test_read_partition_file_handle_protocol_failure ... ok
test file_system::tests::test_encode_ucs2_null_terminated_basic ... ok
test file_system::tests::test_encode_ucs2_null_terminated_path ... ok
test file_system::tests::test_encode_ucs2_null_terminated_empty ... ok
```
The unsafe FFI dispatch paths in `block_io` are exercised against mock `BlockIo` function pointers (capture writes, error propagation, read-only rejection).
Integration Instructions
Consumers depend on `patina_partition = "0.1"` from this repo. Until a `patina` release containing the new APIs is published, consumers needing to build against this crate will also need to redirect `patina` to the `feature/patina-boot` branch (matching the existing pattern in `patina_boot`/`patina_nvme`).
Closes #66 (file-read) and #71 (raw-write) on the SRE board once patina#1489 and patina#1495 are closed in favor of this PR.