Add package for converting tar to erofs#289
Draft
dmcgowan wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Derek McGowan <derek@mcg.dev>
WithTarIndexData enables tar-index mode in Apply. When set, file payload bytes are written to an external data file (via go-erofs WithDataFile) at 512-byte-block-aligned positions, and the EROFS writer records chunk-index entries pointing into that file rather than copying bytes into its internal spool. The resulting EROFS image is metadata-only: filesystem structure, inode table, and chunk-index table. Combining it with the data file produces a blob where a kernel consumer can locate file content directly via DeviceID=1 chunk references. This replaces the mkfs.erofs --tar=i --aufs subprocess invocation with a pure-Go implementation. Block size is set to 512 to match tar's natural granularity (each header block is 512 bytes). Adds three tests: - TestWithTarIndexDataBasic: round-trips a file through the combined blob - TestWithTarIndexDataFileListing: compares file listing with full extraction - TestWithTarIndexDataWhiteouts: verifies OCI whiteout translation Signed-off-by: Derek McGowan <derek@mcg.dev>
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.
Adds package
github.com/containerd/continuity/tarconvwhich uses the go-erofs library to convert a tar stream into erofs.