Binman

Binman

Package firmware into images described by a devicetree, for U-Boot, TF-A and everything else a board needs to boot

Packaging U-Boot with TF-A, which binman builds from source when it is missing, then looking inside the image, extracting an entry and replacing U-Boot

Get started
Documentation
Source on GitHub

What it does

  • Keeps building separate from packaging. Build each piece with its own project and build system, then let binman put them together. U-Boot runs it as part of its build.
  • Works out the layout. The image description says what goes in and any constraints, such as offsets, alignment, padding, compression and hashing. Binman places everything and checks that nothing overlaps.
  • Knows the formats. About 100 entry types cover FIT, CBFS, TF-A FIP and many SoC-specific formats, with sections for images inside images.
  • Finds what is missing. Builds blobs such as TF-A from source and keeps them in a cache, and fetches the tools it needs. It can still build an image with blobs missing, so CI can check a board without them.
  • Looks inside images. Lists, extracts and replaces entries in an existing image, repacking it where needed, and lets firmware find other parts of the image at run time.

Try it

pip install binary-manager

binman build -d u-boot.dtb  # build images
binman ls -i image.bin      # look inside
binman tool -f missing      # fetch tools

Installing it builds pylibfdt, which needs swig and a C compiler. Within U-Boot the build runs binman for you. The manual explains how to use it inside and outside U-Boot.

Links

Binman is free software under the GPL-2.0+ licence.