1 .TH MKIMAGE 1 "2022-02-07"
4 mkimage \- Generate image for U-Boot
8 .BI \-l\~ image-file-name
12 .RI [ option\~ .\|.\|.\&]
18 .RI [ option\~ .\|.\|.\&]
19 .BI \-f\~ image-tree-source-file\c
25 .RI [ option\~ .\|.\|.\&]
26 .BI \-F\~ image-file-name
32 command is used to create images for use with the U-Boot boot loader.
33 These images can contain the linux kernel, device tree blob, root file
34 system image, firmware images etc., either separate or combined.
37 supports two different formats:
41 format concatenates the individual parts (for example, kernel image,
42 device tree blob and ramdisk image) and adds a 64 bytes header
43 containing information about target architecture, operating system,
44 image type, compression method, entry points, time stamp, checksums,
48 .I FIT (Flattened Image Tree) format
49 allows for more flexibility in handling images of various types and also
50 enhances integrity protection of images with stronger checksums. It also
51 supports verified boot.
55 .B List image information:
58 .BI "\-l [" "uimage file name" "]"
59 mkimage lists the information contained in the header of an existing U-Boot image.
62 .BI "\-T [" "image type" "]"
63 Parse image file as type.
64 Pass \-h as the image to see the list of supported image type.
65 Without this option image type is autodetected.
69 Quiet. Don't print the image header on successful verification.
72 .B Create old legacy image:
75 .BI "\-A [" "architecture" "]"
76 Set architecture. Pass \-h as the architecture to see the list of supported architectures.
80 Set operating system. bootm command of u-boot changes boot method by os type.
81 Pass \-h as the OS to see the list of supported OS.
84 .BI "\-T [" "image type" "]"
86 Pass \-h as the image to see the list of supported image type.
89 .BI "\-C [" "compression type" "]"
91 Pass \-h as the compression to see the list of supported compression type.
94 .BI "\-a [" "load address" "]"
95 Set load address with a hex number.
98 .BI "\-e [" "entry point" "]"
99 Set entry point with a hex number.
103 List the contents of an image.
106 .BI "\-n [" "image name" "]"
107 Set image name to 'image name'.
110 .BI "\-R [" "secondary image name" "]"
111 Some image types support a second image for additional data. For these types,
112 use \-R to specify this second image.
117 Image Type Secondary Image Description
118 pblimage Additional RCW-style header, typically used for PBI commands.
119 zynqimage, zynqmpimage T{
120 Initialization parameters, one per line. Each parameter has the form
129 are hexadecimal integers. The boot ROM will write each
133 when loading the image. At most 256 parameters may be specified in this
139 .BI "\-d [" "image data file" "]"
140 Use image data from 'image data file'.
144 Set XIP (execute in place) flag.
148 Don't copy in the image data. Depending on the image type, this may create
149 just the header, everything but the image data, or nothing at all.
153 Verbose. Print file names as they are added to the image.
159 .BI "\-b [" "device tree file" "]
160 Appends the device tree binary file (.dtb) to the FIT.
163 .BI "\-c [" "comment" "]"
164 Specifies a comment to be added when signing. This is typically a useful
165 message which describes how the image was signed or some other useful
169 .BI "\-D [" "dtc options" "]"
170 Provide special options to the device tree compiler that is used to
175 After processing, move the image data outside the FIT and store a data offset
176 in the FIT. Images will be placed one after the other immediately after the
177 FIT, with each one aligned to a 4-byte boundary. The existing 'data' property
178 in each image will be replaced with 'data-offset' and 'data-size' properties.
179 A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned)
183 .BI "\-B [" "alignment" "]"
184 The alignment, in hexadecimal, that external data will be aligned to. This
185 option only has an effect when \-E is specified.
188 .BI "\-f [" "image tree source file" " | " "auto" "]"
189 Image tree source file that describes the structure and contents of the
192 This can be automatically generated for some simple cases.
193 Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a
194 and -e are used to specify the image to include in the FIT and its attributes.
195 No .its file is required.
199 Indicates that an existing FIT image should be modified. No dtc
200 compilation is performed and the \-f flag should not be given.
201 This can be used to sign images with additional keys after initial image
205 .BI "\-i [" "ramdisk_file" "]"
206 Appends the ramdisk file to the FIT.
209 .BI "\-k [" "key_directory" "]"
210 Specifies the directory containing keys to use for signing. This directory
211 should contain a private key file <name>.key for use with signing and a
212 certificate <name>.crt (containing the public key) for use with verification.
215 .BI "\-G [" "key_file" "]"
216 Specifies the private key file to use when signing. This option may be used
220 .BI "\-K [" "key_destination" "]"
221 Specifies a compiled device tree binary file (typically .dtb) to write
222 public key information into. When a private key is used to sign an image,
223 the corresponding public key is written into this file for for run-time
224 verification. Typically the file here is the device tree binary used by
225 CONFIG_OF_CONTROL in U-Boot.
228 .BI "\-G [" "key_file" "]"
229 Specifies the private key file to use when signing. This option may be used
233 .BI "\-g [" "key_name_hint" "]"
234 Sets the key-name-hint property when used with \-f auto. This is the <name>
235 part of the key. The directory part is set by \-k. This option also indicates
236 that the images included in the FIT should be signed. If this option is
237 specified, \-o must be specified as well.
240 .BI "\-o [" "signing algorithm" "]"
241 Specifies the algorithm to be used for signing a FIT image. The default is
242 taken from the signature node's 'algo' property.
245 .BI "\-p [" "external position" "]"
246 Place external data at a static external position. See \-E. Instead of writing
247 a 'data-offset' property defining the offset from the end of the FIT, \-p will
248 use 'data-position' as the absolute position from the base of the FIT.
252 Specifies that keys used to sign the FIT are required. This means that they
253 must be verified for the image to boot. Without this option, the verification
254 will be optional (useful for testing but not for release).
257 .BI "\-N [" "engine" "]"
258 The openssl engine to use when signing and verifying the image. For a complete list of
259 available engines, refer to
264 Update the timestamp in the FIT.
266 Normally the FIT timestamp is created the first time mkimage is run on a FIT,
267 when converting the source .its to the binary .fit file. This corresponds to
268 using the -f flag. But if the original input to mkimage is a binary file
269 (already compiled) then the timestamp is assumed to have been set previously.
273 List image information:
278 Create legacy image with compressed PowerPC Linux kernel:
280 .B mkimage -A powerpc -O linux -T kernel -C gzip \\\\
282 .B -a 0 -e 0 -n Linux -d vmlinux.gz uImage
285 Create FIT image with compressed PowerPC Linux kernel:
287 .B mkimage -f kernel.its kernel.itb
290 Create FIT image with compressed kernel and sign it with keys in the
291 /public/signing-keys directory. Add corresponding public keys into u-boot.dtb,
292 skipping those for which keys cannot be found. Also add a comment.
294 .B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\
296 .B -c """Kernel 3.8 image for production devices""" kernel.itb
300 Add public keys to u-boot.dtb without needing a FIT to sign. This will also
301 create a FIT containing an images node with no data named unused.itb.
303 .B mkimage -f auto -d /dev/null -k /public/signing-keys -g dev \\\\
305 .B -o sha256,rsa2048 -K u-boot.dtb unused.itb
309 Update an existing FIT image, signing it with additional keys.
310 Add corresponding public keys into u-boot.dtb. This will resign all images
311 with keys that are available in the new directory. Images that request signing
312 with unavailable keys are skipped.
314 .B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\
316 .B -c """Kernel 3.8 image for production devices""" kernel.itb
320 Create a FIT image containing a kernel, using automatic mode. No .its file
323 .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
325 .B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
328 Create a FIT image containing a kernel and some device tree files, using
329 automatic mode. No .its file is required.
331 .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
333 .B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\
334 .B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb
337 Create a FIT image containing a signed kernel, using automatic mode. No .its
340 .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
342 .B -d vmlinuz -k /secret/signing-keys -g dev -o sha256,rsa2048 kernel.itb
346 http://www.denx.de/wiki/U-Boot/WebHome
349 This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
350 and Wolfgang Denk <wd@denx.de>. It was updated for image signing by
351 Simon Glass <sjg@chromium.org>.