Minimal Rockchip image pack/unpack utility in C with a cross-platform CLI.
This implements a small, practical subset of Rockchip firmware image handling:
- unpack
RKFWfirmware images - pack
RKFWfirmware images - list
RKFWandRKAFimage contents as YAML without unpacking - unpack standalone
RKAFupdate images - pack standalone
RKAFupdate images - unpack nested
RKAFpayloads found insideRKFW - rebuild nested
RKAFpayloads duringRKFWpacking
It is intentionally narrow. Broader second-layer format handling is not implemented here.
makecmake -S . -B build
cmake --build buildGitHub Actions builds release archives for Linux and Windows.
- pushes and pull requests run CI builds
- pushing a tag like
v1.0.0publishes a GitHub Release with packaged binaries
Linux or macOS:
./rkimg unpack input.img outdir
./rkimg pack outdir rebuilt.img
./rkimg list input.imgWindows:
.\build\Debug\rkimg.exe unpack input.img outdir
.\build\Debug\rkimg.exe pack outdir rebuilt.img
.\build\Debug\rkimg.exe list input.imglist prints YAML describing the container structure, headers, nested entries,
and detected second-layer wrappers without extracting files.
For RKFW images:
outdir/
manifest.ini
loader.bin
update.img
update/
manifest.ini
files/...
For standalone RKAF images:
outdir/
manifest.ini
files/...
manifest.ini stores only the fields needed for minimal round-tripping.
RKFWmanifests include timestamp/header fields plusloader_file,update_file,append_md5, and optionalupdate_dirwhen the payload was unpacked as nestedRKAF.RKAFmanifests include image metadata plus[entryN]sections for each file table entry.
SELFentries are rejected on pack. Those images need extra handling that this minimal utility does not currently replicate.RESERVEDentries are preserved as metadata-only table entries.- Extracted file payloads are written as stored in the image.
- Checksum mismatches during unpack are warnings, not hard failures.