1 .TH MKIMAGE 1 "2022-02-07"
4 mkimage \- generate images 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. These
33 images can contain the Linux kernel, device tree blob, root file system image,
34 firmware images etc., either separate or combined.
37 supports many image formats. Some of these formats may be used by embedded boot
38 firmware to load U-Boot. Others may be used by U-Boot to load Linux (or some
41 The legacy image format concatenates the individual parts (for example, kernel
42 image, device tree blob and ramdisk image) and adds a 64 byte header containing
43 information about the target architecture, operating system, image type,
44 compression method, entry points, time stamp, checksums, etc.
48 (Flattened Image Tree) format allows for more flexibility in handling images of
49 various types and also enhances integrity protection of images with stronger
50 checksums. It also supports verified boot.
58 Print a help message and exit.
63 lists the information contained in the header of an existing U-Boot image.
67 Don't copy in the image data. Depending on the image type, this may create
68 just the header, everything but the image data, or nothing at all.
78 to see the list of supported image types. If this option is absent, then it
81 (legacy image). If this option is absent when
85 will attempt to automatically detect the image type. Not all image types support
86 automatic detection, so it may be necessary to pass
90 When creating a FIT image with
92 the image type is always set to
96 specifies the image node's \(oqtype\(cq property. If
98 is absent, then the \(oqtype\(cq property will default to
103 Quiet. Don't print the image header.
107 Verbose. Print file names as they are added to the image.
111 Print version information and exit.
113 .SS General image-creation options
116 .BI \-A " architecture"
117 Set the architecture. Pass
119 as the architecture to see the list of supported architectures. If
121 is absent, it defaults to
126 Set the operating system. The U-Boot
128 command changes boot method based on the OS type.
133 to see the list of supported OSs. If
135 is absent, it defaults to
139 .BI \-C " compression-type"
140 Set the compression type. The image data should have already been compressed
141 using this compression type.
143 will not automatically compress image data.
148 to see the list of supported compression types. If
150 is absent, it defaults to
154 .BI \-a " load-address"
155 Set the absolute address to load the image data to.
157 will be interpreted as a hexadecimal number.
160 .BI \-e " entry-point"
161 Set the absolute address of the image entry point. The U-Boot
163 command will jump to this address after loading the image.
165 will be interpreted as a hexadecimal number.
168 .BI \-n " image-name"
169 Set the image name to
173 .BI \-R " secondary-image-name"
174 Some image types support a second image for additional data. For these types,
177 to specify this second image.
182 Image Type Secondary Image Description
183 pblimage Additional RCW-style header, typically used for PBI commands.
184 zynqimage, zynqmpimage T{
185 Initialization parameters, one per line. Each parameter has the form
194 are hexadecimal integers. The boot ROM will write each
198 when loading the image. At most 256 parameters may be specified in this
204 .BI \-d " image-data-file"
206 .IR image-data-file .
211 then multiple images may be specified, separated by colons:
214 .IR image-data-file [\fB:\fP image-data-file .\|.\|.]
221 (execute in place) flag. The U-Boot
223 command will not load the image data, and instead will assume it is already
224 accessible at the load address (such as via memory-mapped flash).
226 .SS Options for creating FIT images
229 .BI \-b " device-tree-file"
230 Appends the device tree binary file (.dtb) to the FIT.
234 Specifies a comment to be added when signing. This is typically a message which
235 describes how the image was signed or some other useful information.
238 .BI \-D " dtc-options"
239 Provide additional options to the device tree compiler when creating the image.
242 for documentation of possible options. If
244 is absent, it defaults to
245 .BR "\-I dts \-O dtb \-p 500" .
249 After processing, move the image data outside the FIT and store a data offset
250 in the FIT. Images will be placed one after the other immediately after the FIT,
251 with each one aligned to a 4-byte boundary. The existing \(oqdata\(cq property
252 in each image will be replaced with \(oqdata-offset\(cq and \(oqdata-size\(cq
253 properties. A \(oqdata-offset\(cq of 0 indicates that it starts in the first
254 (4-byte-aligned) byte after the FIT.
258 The alignment, in hexadecimal, that external data will be aligned to. This
259 option only has an effect when \-E is specified.
262 .BI \-p " external-position"
263 Place external data at a static external position. Instead of writing a
264 \(oqdata-offset\(cq property defining the offset from the end of the FIT,
266 will use \(oqdata-position\(cq as the absolute position from the base of the
269 for details on using external data.
272 \fB\-f \fIimage-tree-source-file\fR | \fBauto
273 Image tree source file that describes the structure and contents of the
276 In some simple cases, the image tree source can be generated automatically. To
277 use this feature, pass
288 options may be used to specify the image to include in the FIT and its
290 .I image-tree-source-file
295 Indicates that an existing FIT image should be modified. No dtc compilation will
298 should not be passed. This can be used to sign images with additional keys
299 after initial image creation.
302 .BI \-i " ramdisk-file"
303 Append a ramdisk or initramfs file to the image.
306 .BI \-k " key-directory"
307 Specifies the directory containing keys to use for signing. This directory
308 should contain a private key file
310 for use with signing, and a certificate
312 (containing the public key) for use with verification. The public key is only
313 necessary when embedding it into another device tree using
316 defaults to the value of the signature node's \(oqkey-name-hint\(cq property,
317 but may be overridden using
322 Specifies the private key file to use when signing. This option may be used
326 .BI \-K " key-destination"
327 Specifies a compiled device tree binary file (typically .dtb) to write
328 public key information into. When a private key is used to sign an image,
329 the corresponding public key is written into this file for for run-time
330 verification. Typically the file here is the device tree binary used by
331 CONFIG_OF_CONTROL in U-Boot.
334 .BI \-g " key-name-hint"
335 Overrides the signature node's \(oqkey-name-hint\(cq property. This is
336 especially useful when signing an image with
340 part of the key. The directory part is set by
342 This option also indicates that the images included in the FIT should be signed.
343 If this option is specified, then
345 must be specified as well.
348 .BI \-o " crypto" , checksum
349 Specifies the algorithm to be used for signing a FIT image. The default is
350 taken from the signature node's \(oqalgo\(cq property.
381 Specifies that keys used to sign the FIT are required. This means that they
382 must be verified for the image to boot. Without this option, the verification
383 will be optional (useful for testing but not for release).
387 The openssl engine to use when signing and verifying the image. For a complete
388 list of available engines, refer to
393 Update the timestamp in the FIT.
395 Normally the FIT timestamp is created the first time mkimage runs,
396 when converting the source .its to the binary .fit file. This corresponds to
399 But if the original input to mkimage is a binary file (already compiled), then
400 the timestamp is assumed to have been set previously.
403 Please report bugs to the
404 .UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues
408 .\" Reduce the width of the tab stops to something reasonable
410 List image information:
414 \fBmkimage \-l uImage
418 Create legacy image with compressed PowerPC Linux kernel:
422 \fBmkimage \-A powerpc \-O linux \-T kernel \-C gzip \\
423 \-a 0 \-e 0 \-n Linux \-d vmlinux.gz uImage
427 Create FIT image with compressed PowerPC Linux kernel:
431 \fBmkimage \-f kernel.its kernel.itb
435 Create FIT image with compressed kernel and sign it with keys in the
436 /public/signing\-keys directory. Add corresponding public keys into u\-boot.dtb,
437 skipping those for which keys cannot be found. Also add a comment.
441 \fBmkimage \-f kernel.its \-k /public/signing\-keys \-K u\-boot.dtb \\
442 \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb
446 Add public keys to u\-boot.dtb without needing a FIT to sign. This will also
447 create a FIT containing an images node with no data named unused.itb.
451 \fBmkimage \-f auto \-d /dev/null \-k /public/signing\-keys \-g dev \\
452 \-o sha256,rsa2048 \-K u\-boot.dtb unused.itb
456 Update an existing FIT image, signing it with additional keys.
457 Add corresponding public keys into u\-boot.dtb. This will resign all images
458 with keys that are available in the new directory. Images that request signing
459 with unavailable keys are skipped.
463 \fBmkimage \-F \-k /secret/signing\-keys \-K u\-boot.dtb \\
464 \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb
468 Create a FIT image containing a kernel, using automatic mode. No .its file
473 \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\
474 \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz kernel.itb
478 Create a FIT image containing a kernel and some device tree files, using
479 automatic mode. No .its file is required.
483 \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\
484 \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz \\
485 \-b /path/to/rk3288\-firefly.dtb \-b /path/to/rk3288\-jerry.dtb kernel.itb
489 Create a FIT image containing a signed kernel, using automatic mode. No .its
494 \fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\
495 \-d vmlinuz \-k /secret/signing\-keys \-g dev \-o sha256,rsa2048 kernel.itb
501 This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
502 and Wolfgang Denk <wd@denx.de>. It was updated for image signing by
503 Simon Glass <sjg@chromium.org>.
509 .UR https://\:u-boot\:.readthedocs\:.io/\:en/\:latest/\:index.html