Skip to content

cpio-archive: fix trailer for pax, bsd, and gnu#277

Open
mcandre wants to merge 7 commits intoindygreg:mainfrom
mcandre:pax
Open

cpio-archive: fix trailer for pax, bsd, and gnu#277
mcandre wants to merge 7 commits intoindygreg:mainfrom
mcandre:pax

Conversation

@mcandre
Copy link

@mcandre mcandre commented Jan 29, 2026

Enhanced finish() to follow bsdcpio (libarchive) trailer logic more closely:

  • Essentially calloc (zero out) most trailing header fields.
  • Track bytes written, in order to zero pad the writer to the conventional CPIO 512 byte block size.

This enables cpio-archive generated files to pass pax -v <test.cpio without triggering early volume end warnings. In fact, the CPIO Payload is now MD5 equivalent to one generated by pkgbuild, as long as resource forks are included.

Relates to #269

macOS installer continues to reject my cpio streams. But we're getting closer. The damage is now limited to the gzip stream, or more likely the Bom.

@mcandre mcandre changed the title fix trailer for pax, bsd, and gnu cpio-archive: fix trailer for pax, bsd, and gnu Jan 29, 2026
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