Skip to content

Commit 0585802

Browse files
committed
ostree-ext: Add composefs-repo to ostree-commit synthesis
Add `container::composefs_import::import_from_composefs_repo`, which walks a composefs `FileSystem` tree (already populated by a composefs-rs OCI pull) and synthesizes an equivalent ostree commit, reflinking file content into the ostree bare repo so the same disk blocks back both stores. This is the inverse of libostree's ostree→EROFS path. (Except of course, it is all still very circular because what happens here is ostree then turns around and uses composefs-c to make a composefs EROFS...that's a whole thing that in theory we could replace too) To support exporting such synthesized commits back out, `store.rs` gains `export_commit` (export straight from a commit checksum rather than an image ref) and `for_each_file_checksum` (walk a commit's regular-file content checksums), `export_to_oci` is refactored to take a `LayeredImageState` so both ref- and commit-based exports share it, and `query_image_commit` learns to treat a composefs-synthesized merge commit as its own base. A few existing metadata constants and helpers are promoted to `pub`/`pub(crate)` for use by the new module. This is library plumbing for bootc's unified storage work; it is unused by any in-tree caller on its own and lands separately to keep that feature's change set reviewable. Includes a standalone integration test (`test_composefs_import_to_ostree`) that builds a small OCI image, imports it through a composefs repo into ostree, and verifies the result. Assisted-by: OpenCode (claude-opus-4-8) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 220f404 commit 0585802

6 files changed

Lines changed: 1405 additions & 50 deletions

File tree

0 commit comments

Comments
 (0)