CPIO Archive (.cpio)

Unix copy-in/copy-out archive.

Overview

Each cpio member has a header and the file name, then data padded to 2 or 4 bytes. Formats include old binary, ODC (070707), newc (070701) and CRC (070702), and the archive ends with a member named TRAILER!!!.

Where it is used

  • Linux initramfs images and RPM payloads.

History

  • Created for Unix PWB/Unix in the 1970s.

Status today

  • Still widely used for initramfs and packages.

Structures read by the implementation

Offsets are in bytes from the start of the buffer named in each heading. Field names are taken from the implementation and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

No fixed-offset structures were found in the implementation.

Constants

General CpioArchiveModule

NameValueTypeNotes
ModeDir0x4000intS_IFDIR

Implementation limits reader

ClassNameValueNotes
CpioCarverMaxEntries5_000_000
CpioCarverMaxNameSize65536
CpioArchiveModuleMaxEntries5_000_000
Structures and constants were extracted from: Carving/Plugins/Cpio/CpioCarver.cs, Modules/FileSystems/CpioArchiveModule.cs. Prose sections are a summary from public sources; verify details before relying on them.