1 .TH MKIMAGE 1 "2022-02-07"
4 mkimage \- Generate image for U-Boot
7 .RB [ \-T " \fItype\fP] " \-l " [\fIuimage file name\fP]"
10 .RB [\fIoptions\fP] " \-f [" "image tree source file" "]" " [" "uimage file name" "]"
13 .RB [\fIoptions\fP] " \-F [" "uimage file name" "]"
16 .RB [\fIoptions\fP] " (legacy mode)"
21 command is used to create images for use with the U-Boot boot loader.
22 These images can contain the linux kernel, device tree blob, root file
23 system image, firmware images etc., either separate or combined.
26 supports two different formats:
30 format concatenates the individual parts (for example, kernel image,
31 device tree blob and ramdisk image) and adds a 64 bytes header
32 containing information about target architecture, operating system,
33 image type, compression method, entry points, time stamp, checksums,
37 .I FIT (Flattened Image Tree) format
38 allows for more flexibility in handling images of various types and also
39 enhances integrity protection of images with stronger checksums. It also
40 supports verified boot.
44 .B List image information:
47 .BI "\-l [" "uimage file name" "]"
48 mkimage lists the information contained in the header of an existing U-Boot image.
51 .BI "\-T [" "image type" "]"
52 Parse image file as type.
53 Pass \-h as the image to see the list of supported image type.
54 Without this option image type is autodetected.
58 Quiet. Don't print the image header on successful verification.
61 .B Create old legacy image:
64 .BI "\-A [" "architecture" "]"
65 Set architecture. Pass \-h as the architecture to see the list of supported architectures.
69 Set operating system. bootm command of u-boot changes boot method by os type.
70 Pass \-h as the OS to see the list of supported OS.
73 .BI "\-T [" "image type" "]"
75 Pass \-h as the image to see the list of supported image type.
78 .BI "\-C [" "compression type" "]"
80 Pass \-h as the compression to see the list of supported compression type.
83 .BI "\-a [" "load address" "]"
84 Set load address with a hex number.
87 .BI "\-e [" "entry point" "]"
88 Set entry point with a hex number.
92 List the contents of an image.
95 .BI "\-n [" "image name" "]"
96 Set image name to 'image name'.
99 .BI "\-R [" "secondary image name" "]"
100 Some image types support a second image for additional data. For these types,
101 use \-R to specify this second image.
106 Image Type Secondary Image Description
107 pblimage Additional RCW-style header, typically used for PBI commands.
108 zynqimage, zynqmpimage T{
109 Initialization parameters, one per line. Each parameter has the form
118 are hexadecimal integers. The boot ROM will write each
122 when loading the image. At most 256 parameters may be specified in this
128 .BI "\-d [" "image data file" "]"
129 Use image data from 'image data file'.
133 Set XIP (execute in place) flag.
137 Don't copy in the image data. Depending on the image type, this may create
138 just the header, everything but the image data, or nothing at all.
142 Verbose. Print file names as they are added to the image.
148 .BI "\-b [" "device tree file" "]
149 Appends the device tree binary file (.dtb) to the FIT.
152 .BI "\-c [" "comment" "]"
153 Specifies a comment to be added when signing. This is typically a useful
154 message which describes how the image was signed or some other useful
158 .BI "\-D [" "dtc options" "]"
159 Provide special options to the device tree compiler that is used to
164 After processing, move the image data outside the FIT and store a data offset
165 in the FIT. Images will be placed one after the other immediately after the
166 FIT, with each one aligned to a 4-byte boundary. The existing 'data' property
167 in each image will be replaced with 'data-offset' and 'data-size' properties.
168 A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned)
172 .BI "\-B [" "alignment" "]"
173 The alignment, in hexadecimal, that external data will be aligned to. This
174 option only has an effect when \-E is specified.
177 .BI "\-f [" "image tree source file" " | " "auto" "]"
178 Image tree source file that describes the structure and contents of the
181 This can be automatically generated for some simple cases.
182 Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a
183 and -e are used to specify the image to include in the FIT and its attributes.
184 No .its file is required.
188 Indicates that an existing FIT image should be modified. No dtc
189 compilation is performed and the \-f flag should not be given.
190 This can be used to sign images with additional keys after initial image
194 .BI "\-i [" "ramdisk_file" "]"
195 Appends the ramdisk file to the FIT.
198 .BI "\-k [" "key_directory" "]"
199 Specifies the directory containing keys to use for signing. This directory
200 should contain a private key file <name>.key for use with signing and a
201 certificate <name>.crt (containing the public key) for use with verification.
204 .BI "\-G [" "key_file" "]"
205 Specifies the private key file to use when signing. This option may be used
209 .BI "\-K [" "key_destination" "]"
210 Specifies a compiled device tree binary file (typically .dtb) to write
211 public key information into. When a private key is used to sign an image,
212 the corresponding public key is written into this file for for run-time
213 verification. Typically the file here is the device tree binary used by
214 CONFIG_OF_CONTROL in U-Boot.
217 .BI "\-G [" "key_file" "]"
218 Specifies the private key file to use when signing. This option may be used
222 .BI "\-g [" "key_name_hint" "]"
223 Sets the key-name-hint property when used with \-f auto. This is the <name>
224 part of the key. The directory part is set by \-k. This option also indicates
225 that the images included in the FIT should be signed. If this option is
226 specified, \-o must be specified as well.
229 .BI "\-o [" "signing algorithm" "]"
230 Specifies the algorithm to be used for signing a FIT image. The default is
231 taken from the signature node's 'algo' property.
234 .BI "\-p [" "external position" "]"
235 Place external data at a static external position. See \-E. Instead of writing
236 a 'data-offset' property defining the offset from the end of the FIT, \-p will
237 use 'data-position' as the absolute position from the base of the FIT.
241 Specifies that keys used to sign the FIT are required. This means that they
242 must be verified for the image to boot. Without this option, the verification
243 will be optional (useful for testing but not for release).
246 .BI "\-N [" "engine" "]"
247 The openssl engine to use when signing and verifying the image. For a complete list of
248 available engines, refer to
253 Update the timestamp in the FIT.
255 Normally the FIT timestamp is created the first time mkimage is run on a FIT,
256 when converting the source .its to the binary .fit file. This corresponds to
257 using the -f flag. But if the original input to mkimage is a binary file
258 (already compiled) then the timestamp is assumed to have been set previously.
262 List image information:
267 Create legacy image with compressed PowerPC Linux kernel:
269 .B mkimage -A powerpc -O linux -T kernel -C gzip \\\\
271 .B -a 0 -e 0 -n Linux -d vmlinux.gz uImage
274 Create FIT image with compressed PowerPC Linux kernel:
276 .B mkimage -f kernel.its kernel.itb
279 Create FIT image with compressed kernel and sign it with keys in the
280 /public/signing-keys directory. Add corresponding public keys into u-boot.dtb,
281 skipping those for which keys cannot be found. Also add a comment.
283 .B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\
285 .B -c """Kernel 3.8 image for production devices""" kernel.itb
289 Add public keys to u-boot.dtb without needing a FIT to sign. This will also
290 create a FIT containing an images node with no data named unused.itb.
292 .B mkimage -f auto -d /dev/null -k /public/signing-keys -g dev \\\\
294 .B -o sha256,rsa2048 -K u-boot.dtb unused.itb
298 Update an existing FIT image, signing it with additional keys.
299 Add corresponding public keys into u-boot.dtb. This will resign all images
300 with keys that are available in the new directory. Images that request signing
301 with unavailable keys are skipped.
303 .B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\
305 .B -c """Kernel 3.8 image for production devices""" kernel.itb
309 Create a FIT image containing a kernel, using automatic mode. No .its file
312 .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
314 .B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
317 Create a FIT image containing a kernel and some device tree files, using
318 automatic mode. No .its file is required.
320 .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
322 .B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\
323 .B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb
326 Create a FIT image containing a signed kernel, using automatic mode. No .its
329 .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
331 .B -d vmlinuz -k /secret/signing-keys -g dev -o sha256,rsa2048 kernel.itb
335 http://www.denx.de/wiki/U-Boot/WebHome
338 This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
339 and Wolfgang Denk <wd@denx.de>. It was updated for image signing by
340 Simon Glass <sjg@chromium.org>.