blob: fea52887846c3e1572683186964774ef95fbdb8e [file] [log] [blame]
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +09001.TH MKIMAGE 1 "2010-05-16"
2
3.SH NAME
4mkimage \- Generate image for U-Boot
5.SH SYNOPSIS
6.B mkimage
Simon Glass80e4df82013-06-13 15:10:03 -07007.RB "\-l [" "uimage file name" "]"
8
9.B mkimage
10.RB [\fIoptions\fP] " \-f [" "image tree source file" "]" " [" "uimage file name" "]"
11
12.B mkimage
Simon Glass95d77b42013-06-13 15:10:05 -070013.RB [\fIoptions\fP] " \-F [" "uimage file name" "]"
14
15.B mkimage
Simon Glass80e4df82013-06-13 15:10:03 -070016.RB [\fIoptions\fP] " (legacy mode)"
17
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090018.SH "DESCRIPTION"
19The
20.B mkimage
21command is used to create images for use with the U-Boot boot loader.
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +000022These images can contain the linux kernel, device tree blob, root file
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090023system image, firmware images etc., either separate or combined.
24
25.B mkimage
26supports two different formats:
27
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +000028The old
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090029.I legacy image
30format concatenates the individual parts (for example, kernel image,
31device tree blob and ramdisk image) and adds a 64 bytes header
32containing information about target architecture, operating system,
33image type, compression method, entry points, time stamp, checksums,
34etc.
35
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +000036The new
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090037.I FIT (Flattened Image Tree) format
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +000038allows for more flexibility in handling images of various types and also
Simon Glass80e4df82013-06-13 15:10:03 -070039enhances integrity protection of images with stronger checksums. It also
40supports verified boot.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090041
42.SH "OPTIONS"
43
44.B List image information:
45
46.TP
47.BI "\-l [" "uimage file name" "]"
48mkimage lists the information contained in the header of an existing U-Boot image.
49
50.P
51.B Create old legacy image:
52
53.TP
54.BI "\-A [" "architecture" "]"
Loïc Minier3f1266d2011-01-04 02:32:36 +010055Set architecture. Pass \-h as the architecture to see the list of supported architectures.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090056
57.TP
58.BI "\-O [" "os" "]"
59Set operating system. bootm command of u-boot changes boot method by os type.
Loïc Minier3f1266d2011-01-04 02:32:36 +010060Pass \-h as the OS to see the list of supported OS.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090061
62.TP
63.BI "\-T [" "image type" "]"
64Set image type.
Loïc Minier3f1266d2011-01-04 02:32:36 +010065Pass \-h as the image to see the list of supported image type.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090066
67.TP
68.BI "\-C [" "compression type" "]"
69Set compression type.
Loïc Minier3f1266d2011-01-04 02:32:36 +010070Pass \-h as the compression to see the list of supported compression type.
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090071
72.TP
Jelle van der Waa4fd096f2016-09-14 21:54:53 +020073.BI "\-a [" "load address" "]"
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090074Set load address with a hex number.
75
76.TP
77.BI "\-e [" "entry point" "]"
78Set entry point with a hex number.
79
80.TP
Simon Glass80e4df82013-06-13 15:10:03 -070081.BI "\-l"
82List the contents of an image.
83
84.TP
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +090085.BI "\-n [" "image name" "]"
86Set image name to 'image name'.
87
88.TP
89.BI "\-d [" "image data file" "]"
90Use image data from 'image data file'.
91
92.TP
93.BI "\-x"
94Set XIP (execute in place) flag.
95
96.P
97.B Create FIT image:
98
99.TP
Andreas Bießmann7a439ca2016-05-01 03:01:27 +0200100.BI "\-b [" "device tree file" "]
101Appends the device tree binary file (.dtb) to the FIT.
Simon Glassfb4cce02016-02-22 22:55:52 -0700102
103.TP
Simon Glass4f610422013-06-13 15:10:06 -0700104.BI "\-c [" "comment" "]"
105Specifies a comment to be added when signing. This is typically a useful
106message which describes how the image was signed or some other useful
107information.
108
109.TP
Horst Kronstorfer49fbf432011-12-23 05:40:20 +0000110.BI "\-D [" "dtc options" "]"
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900111Provide special options to the device tree compiler that is used to
112create the image.
113
114.TP
Simon Glass722ebc82016-02-22 22:55:53 -0700115.BI "\-E
116After processing, move the image data outside the FIT and store a data offset
117in the FIT. Images will be placed one after the other immediately after the
118FIT, with each one aligned to a 4-byte boundary. The existing 'data' property
119in each image will be replaced with 'data-offset' and 'data-size' properties.
120A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned)
121byte after the FIT.
122
123.TP
Simon Glass8e35bb02016-02-22 22:55:51 -0700124.BI "\-f [" "image tree source file" " | " "auto" "]"
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +0000125Image tree source file that describes the structure and contents of the
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900126FIT image.
127
Simon Glass8e35bb02016-02-22 22:55:51 -0700128This can be automatically generated for some simple cases.
129Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a
130and -e are used to specify the image to include in the FIT and its attributes.
131No .its file is required.
132
Simon Glass80e4df82013-06-13 15:10:03 -0700133.TP
Simon Glass95d77b42013-06-13 15:10:05 -0700134.BI "\-F"
135Indicates that an existing FIT image should be modified. No dtc
Vagrant Cascadian758497c2014-11-01 18:09:01 -0700136compilation is performed and the \-f flag should not be given.
Simon Glass95d77b42013-06-13 15:10:05 -0700137This can be used to sign images with additional keys after initial image
138creation.
139
140.TP
Tomeu Vizoso0f7c6cd2016-11-04 14:22:15 +0100141.BI "\-i [" "ramdisk_file" "]"
142Appends the ramdisk file to the FIT.
143
144.TP
Simon Glass80e4df82013-06-13 15:10:03 -0700145.BI "\-k [" "key_directory" "]"
146Specifies the directory containing keys to use for signing. This directory
147should contain a private key file <name>.key for use with signing and a
148certificate <name>.crt (containing the public key) for use with verification.
149
Simon Glasse29495d2013-06-13 15:10:04 -0700150.TP
151.BI "\-K [" "key_destination" "]"
152Specifies a compiled device tree binary file (typically .dtb) to write
153public key information into. When a private key is used to sign an image,
154the corresponding public key is written into this file for for run-time
155verification. Typically the file here is the device tree binary used by
156CONFIG_OF_CONTROL in U-Boot.
157
Simon Glass399c7442013-06-13 15:10:07 -0700158.TP
Teddy Reedf8f91072016-06-09 19:38:02 -0700159.BI "\-p [" "external position" "]"
160Place external data at a static external position. See \-E. Instead of writing
161a 'data-offset' property defining the offset from the end of the FIT, \-p will
162use 'data-position' as the absolute position from the base of the FIT.
163
164.TP
Simon Glass399c7442013-06-13 15:10:07 -0700165.BI "\-r
166Specifies that keys used to sign the FIT are required. This means that they
167must be verified for the image to boot. Without this option, the verification
168will be optional (useful for testing but not for release).
169
Simon Glass152b2462020-07-09 18:39:43 -0600170.TP
171.BI "\-t
172Update the timestamp in the FIT.
173
174Normally the FIT timestamp is created the first time mkimage is run on a FIT,
175when converting the source .its to the binary .fit file. This corresponds to
176using the -f flag. But if the original input to mkimage is a binary file
177(already compiled) then the timestamp is assumed to have been set previously.
178
Horst Kronstorfer7aecfdd2011-12-21 04:31:23 +0000179.SH EXAMPLES
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900180
181List image information:
182.nf
183.B mkimage -l uImage
184.fi
185.P
186Create legacy image with compressed PowerPC Linux kernel:
187.nf
188.B mkimage -A powerpc -O linux -T kernel -C gzip \\\\
189.br
190.B -a 0 -e 0 -n Linux -d vmlinux.gz uImage
191.fi
192.P
193Create FIT image with compressed PowerPC Linux kernel:
194.nf
195.B mkimage -f kernel.its kernel.itb
196.fi
Simon Glasse29495d2013-06-13 15:10:04 -0700197.P
198Create FIT image with compressed kernel and sign it with keys in the
199/public/signing-keys directory. Add corresponding public keys into u-boot.dtb,
200skipping those for which keys cannot be found. Also add a comment.
201.nf
202.B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\
Vagrant Cascadian758497c2014-11-01 18:09:01 -0700203.br
Simon Glass3837ce62016-02-22 22:55:49 -0700204.B -c """Kernel 3.8 image for production devices""" kernel.itb
Simon Glasse29495d2013-06-13 15:10:04 -0700205.fi
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900206
Simon Glass95d77b42013-06-13 15:10:05 -0700207.P
208Update an existing FIT image, signing it with additional keys.
209Add corresponding public keys into u-boot.dtb. This will resign all images
210with keys that are available in the new directory. Images that request signing
211with unavailable keys are skipped.
212.nf
213.B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\
Vagrant Cascadian758497c2014-11-01 18:09:01 -0700214.br
Simon Glass3837ce62016-02-22 22:55:49 -0700215.B -c """Kernel 3.8 image for production devices""" kernel.itb
Simon Glass95d77b42013-06-13 15:10:05 -0700216.fi
217
Simon Glass8e35bb02016-02-22 22:55:51 -0700218.P
219Create a FIT image containing a kernel, using automatic mode. No .its file
220is required.
221.nf
222.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
223.br
224.B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
225.fi
Simon Glassfb4cce02016-02-22 22:55:52 -0700226.P
227Create a FIT image containing a kernel and some device tree files, using
228automatic mode. No .its file is required.
229.nf
230.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
231.br
232.B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\
Andreas Bießmann7a439ca2016-05-01 03:01:27 +0200233.B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb
Simon Glassfb4cce02016-02-22 22:55:52 -0700234.fi
Simon Glass8e35bb02016-02-22 22:55:51 -0700235
Nobuhiro Iwamatsucd153552010-06-16 10:38:24 +0900236.SH HOMEPAGE
237http://www.denx.de/wiki/U-Boot/WebHome
238.PP
239.SH AUTHOR
240This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Simon Glass80e4df82013-06-13 15:10:03 -0700241and Wolfgang Denk <wd@denx.de>. It was updated for image signing by
242Simon Glass <sjg@chromium.org>.