]> git.ipfire.org Git - people/ms/u-boot.git/blame - doc/mkimage.1
Merge git://git.denx.de/u-boot-mmc
[people/ms/u-boot.git] / doc / mkimage.1
CommitLineData
cd153556
NI
1.TH MKIMAGE 1 "2010-05-16"
2
3.SH NAME
4mkimage \- Generate image for U-Boot
5.SH SYNOPSIS
6.B mkimage
80e4df8a
SG
7.RB "\-l [" "uimage file name" "]"
8
9.B mkimage
10.RB [\fIoptions\fP] " \-f [" "image tree source file" "]" " [" "uimage file name" "]"
11
95d77b44
SG
12.B mkimage
13.RB [\fIoptions\fP] " \-F [" "uimage file name" "]"
14
80e4df8a
SG
15.B mkimage
16.RB [\fIoptions\fP] " (legacy mode)"
17
cd153556
NI
18.SH "DESCRIPTION"
19The
20.B mkimage
21command is used to create images for use with the U-Boot boot loader.
7aecfdd0 22These images can contain the linux kernel, device tree blob, root file
cd153556
NI
23system image, firmware images etc., either separate or combined.
24
25.B mkimage
26supports two different formats:
27
7aecfdd0 28The old
cd153556
NI
29.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
7aecfdd0 36The new
cd153556 37.I FIT (Flattened Image Tree) format
7aecfdd0 38allows for more flexibility in handling images of various types and also
80e4df8a
SG
39enhances integrity protection of images with stronger checksums. It also
40supports verified boot.
cd153556
NI
41
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" "]"
3f1266d6 55Set architecture. Pass \-h as the architecture to see the list of supported architectures.
cd153556
NI
56
57.TP
58.BI "\-O [" "os" "]"
59Set operating system. bootm command of u-boot changes boot method by os type.
3f1266d6 60Pass \-h as the OS to see the list of supported OS.
cd153556
NI
61
62.TP
63.BI "\-T [" "image type" "]"
64Set image type.
3f1266d6 65Pass \-h as the image to see the list of supported image type.
cd153556
NI
66
67.TP
68.BI "\-C [" "compression type" "]"
69Set compression type.
3f1266d6 70Pass \-h as the compression to see the list of supported compression type.
cd153556
NI
71
72.TP
4fd096f4 73.BI "\-a [" "load address" "]"
cd153556
NI
74Set load address with a hex number.
75
76.TP
77.BI "\-e [" "entry point" "]"
78Set entry point with a hex number.
79
80e4df8a
SG
80.TP
81.BI "\-l"
82List the contents of an image.
83
cd153556
NI
84.TP
85.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
fb4cce0f 99.TP
7a439cad
AB
100.BI "\-b [" "device tree file" "]
101Appends the device tree binary file (.dtb) to the FIT.
fb4cce0f 102
4f610427
SG
103.TP
104.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
cd153556 109.TP
49fbf437 110.BI "\-D [" "dtc options" "]"
cd153556
NI
111Provide special options to the device tree compiler that is used to
112create the image.
113
722ebc8f
SG
114.TP
115.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
cd153556 123.TP
8e35bb07 124.BI "\-f [" "image tree source file" " | " "auto" "]"
7aecfdd0 125Image tree source file that describes the structure and contents of the
cd153556
NI
126FIT image.
127
8e35bb07
SG
128This 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
95d77b44
SG
133.TP
134.BI "\-F"
135Indicates that an existing FIT image should be modified. No dtc
758497c3 136compilation is performed and the \-f flag should not be given.
95d77b44
SG
137This can be used to sign images with additional keys after initial image
138creation.
139
0f7c6cdc
TV
140.TP
141.BI "\-i [" "ramdisk_file" "]"
142Appends the ramdisk file to the FIT.
143
80e4df8a
SG
144.TP
145.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
e29495d3
SG
150.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
f8f9107d
TR
158.TP
159.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
399c744b
SG
164.TP
165.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
7aecfdd0 170.SH EXAMPLES
cd153556
NI
171
172List image information:
173.nf
174.B mkimage -l uImage
175.fi
176.P
177Create legacy image with compressed PowerPC Linux kernel:
178.nf
179.B mkimage -A powerpc -O linux -T kernel -C gzip \\\\
180.br
181.B -a 0 -e 0 -n Linux -d vmlinux.gz uImage
182.fi
183.P
184Create FIT image with compressed PowerPC Linux kernel:
185.nf
186.B mkimage -f kernel.its kernel.itb
187.fi
e29495d3
SG
188.P
189Create FIT image with compressed kernel and sign it with keys in the
190/public/signing-keys directory. Add corresponding public keys into u-boot.dtb,
191skipping those for which keys cannot be found. Also add a comment.
192.nf
193.B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\
758497c3 194.br
3837ce65 195.B -c """Kernel 3.8 image for production devices""" kernel.itb
e29495d3 196.fi
cd153556 197
95d77b44
SG
198.P
199Update an existing FIT image, signing it with additional keys.
200Add corresponding public keys into u-boot.dtb. This will resign all images
201with keys that are available in the new directory. Images that request signing
202with unavailable keys are skipped.
203.nf
204.B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\
758497c3 205.br
3837ce65 206.B -c """Kernel 3.8 image for production devices""" kernel.itb
95d77b44
SG
207.fi
208
8e35bb07
SG
209.P
210Create a FIT image containing a kernel, using automatic mode. No .its file
211is required.
212.nf
213.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
214.br
215.B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
216.fi
fb4cce0f
SG
217.P
218Create a FIT image containing a kernel and some device tree files, using
219automatic mode. No .its file is required.
220.nf
221.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
222.br
223.B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\
7a439cad 224.B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb
fb4cce0f 225.fi
8e35bb07 226
cd153556
NI
227.SH HOMEPAGE
228http://www.denx.de/wiki/U-Boot/WebHome
229.PP
230.SH AUTHOR
231This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
80e4df8a
SG
232and Wolfgang Denk <wd@denx.de>. It was updated for image signing by
233Simon Glass <sjg@chromium.org>.