Skip to content

Add package for converting tar to erofs#289

Draft
dmcgowan wants to merge 2 commits into
containerd:mainfrom
dmcgowan:tar-erofs
Draft

Add package for converting tar to erofs#289
dmcgowan wants to merge 2 commits into
containerd:mainfrom
dmcgowan:tar-erofs

Conversation

@dmcgowan

@dmcgowan dmcgowan commented Jun 2, 2026

Copy link
Copy Markdown
Member

Adds package github.com/containerd/continuity/tarconv which uses the go-erofs library to convert a tar stream into erofs.

dmcgowan added 2 commits June 2, 2026 00:04
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant