Introduction
A FIT image (flattened image tree, .itb) is U-Boot’s newer way of packaging what it boots. It is a
devicetree blob: the same header, memory reservation block, structure block and strings block, with
the files themselves, the kernel, the devicetree, the RAM disk, as properties of nodes in the tree. Compared with the legacy
uImage it holds several images in one file, can say which combination boots on which board, and
carries stronger hashes and signatures. A FIT is made by mkimage from a source file (.its) that is itself devicetree source.
The property names and value lists on this page are from the FIT specification (the project that U-Boot’s own documentation of the format moved to; its single-page HTML was read in full, and the descriptions are in our own words).
The tree
- The root node has
description(optional),timestamp(mandatory:mkimagesets it) and#address-cells(when load or entry addresses are used). /images(mandatory): one node for each image, with at least one./configurations(mandatory): adefaultproperty naming one configuration, and one node for each configuration.
Images
Each node of /images is one file. Its properties:
description,type,compression: mandatory.arch(for standalone, kernel, firmware, ramdisk and devicetree images),os(kernel),loadandentry(firmware and kernel): where they apply.data: the bytes of the file, unless the data is external (below).data-size,data-offset,data-position: external data.phase("spl"or"u-boot") is optional.image-data: the unit name of another image whose bytes this one shares (the producer fills in the real data properties; a loader ignoresimage-data; the target must not have one itself, so there are no chains; nothing else is inherited). The viewer follows it only when the node has no data of its own.compatible: how an image is loaded, mandatory forfpgaimages and for images with no load address (u-boot,fpga-legacy,u-boot,zynqmp-fpga-ddrauth,u-boot,zynqmp-fpga-enc). On aflat_dtimage it is not the board’s model: that goes on the configuration.- sub-nodes
hash-1,hash-2…,signature-1…, anddm-verity(forfilesystemimages:data-block-size,hash-block-size,num-data-blocks,hash-start-block,algo,digest,salt, and the optional booleansrestart-on-corruption,panic-on-corruption,restart-on-error,panic-on-error,check-at-most-once),logo(format"image/bmp"(support mandatory) or"image/png", optionalbackground"light"or"dark"; mandatory forlogoimages) andos-info(nameandversionmandatory; optionalid,id-like,image-id,image-version,pretty-name,home-url,os-variant,variant-id,vendor-name,vendor-url,version-codename,version-id).
The values of type are kernel, kernel_noload, ramdisk, flat_dt, script,
firmware, standalone, filesystem, fpga, tee, multi, logo and thirty-five more named for chips and
boot ROMs, and invalid (48 values in all); compression is none, gzip, bzip2, lzma, lzo, lz4 or zstd;
arch and os are lower-case names such as arm64, arm, riscv, x86_64 and linux,
u-boot, efi. The viewer lists the full sets and reports a value that is not in them.
Hashes and signatures
A hash-N sub-node has algo and value: the digest of the image’s data. The sizes are crc32 4 bytes, md5 16, sha1 20,
sha256 32, sha384 48 and sha512 64 (and crc16-ccitt, 2). The viewer works out all of them over the data, compares, and says
matches or does not match with the digest the data really gives. crc16-ccitt is not specified in the FIT document; the viewer follows U-Boot’s
code (lib/crc16-ccitt.c, common/hash.c): polynomial 0x1021 (x16+x12+x5+1), start value 0, no reflection, no final inversion, the two bytes stored big-endian.
A signature-N sub-node has algo (sha1,rsa2048 256 bytes, sha1,rsa3072 384, sha1,rsa4096 512, sha1,ecdsa256 32;
sha256, sha384 or sha512 may replace the sha1 part), key-name-hint and value; the signer adds hashed-nodes,
hashed-strings (start and size of the hashed part of the strings block) and optionally timestamp, signer-name, signer-version, comment and
padding (pkcs-1.5, the default, or pss); sign-images is deprecated. Checking a signature needs the public key, which the file does not
contain, so signatures are listed as not verified: they are never verified and no key is trusted. The viewer reads them structurally in a "FIT signatures" table, for images and for configurations:
the algorithm split into its hash (sha1, sha256, sha384 or sha512) and scheme (rsa2048, rsa3072, rsa4096 or an ecdsa one), the length of value against the scheme
(an RSA signature is as long as the key: 256, 384 or 512 bytes; an ECDSA one is not judged), the key name hint, the signer's timestamp, name and padding, and the hashed nodes,
and it reports a missing algo or value, an unknown hash or scheme and a value of the wrong length. The hash and scheme lists are the ones above, from the FIT specification (read in an earlier check; U-Boot's own signature document was not read for this, so a scheme it adds that is not named here is reported as unknown). No real signed FIT was available: this is checked on built images only.
Configurations
A configuration node has description (mandatory) and names images: kernel or firmware (one is mandatory unless the configuration has load-only; if both
are given, control goes to the firmware), fdt (a list: the base blob, then overlays that are applied to it), ramdisk and cmdline (a UTF-8 string passed to the next stage; both only with a
kernel), loadables (a list, loaded at their load addresses), script, fpga, logos (logo images in order of preference, at least one a BMP), and a
compatible string that a boot loader can match against its own board (when absent it is taken from an uncompressed fdt; U-Boot needs CONFIG_FIT_BEST_MATCH for it).
load-only (empty) says the configuration need not contain an executable image. A configuration may also carry signature-N sub-nodes with the same properties as an image signature.
The /configurations node has an optional default and at least one configuration. The viewer shows the table of configurations (not cmdline), marks the default, and reports a name
that is not an image of /images (logos included) and a default that is not a configuration.
External data
With mkimage -E the images’ data is not in the tree but after it, so that a loader can read the header, take totalsize bytes and fetch the images later.
Each image then has data-offset (the offset from the end of the blob, which is rounded up to a multiple of 4) and data-size, or data-position (a fixed
memory address, which is not in the file). The viewer follows data-offset and hashes the bytes there; for data-position the hash is not checked.
What the viewer shows
A .itb opens as a devicetree, with every node and property, plus the FIT tables: the images (name, type, architecture, OS, compression, load and entry
addresses, size, and the result of each hash), the hashes, and the configurations. Each image’s data opens as the file it is: a kernel as an ARM64 Image or
zImage by its magic, a gzip image as gzip, a flat_dt image as a devicetree. The mandatory properties above are checked.
No real .itb was available for these pages: the checks were made on built images, with Node’s crypto and zlib as the second route for the hashes, and on a FIT compiled by dtc.
Not described
Known, not yet covered
- Viewer: signatures are read structurally but never verified (a key is needed; by design); the
dm-verity,logoandos-infosub-nodes and thephaseproperty are shown as ordinary properties, not interpreted; configuration signatures and a configuration’scmdlineare not shown in the tables. - Reference: the Specification’s chapter 6 (how a boot loader selects, loads and fixes up images, multi-step loading, the dm-verity command-line translation, the boot menu) and the chapters on signing and security (what a signature covers, hashed-strings, after-signing) are not described here.