Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 1 | .TH MKIMAGE 1 "2010-05-16" |
| 2 | |
| 3 | .SH NAME |
| 4 | mkimage \- Generate image for U-Boot |
| 5 | .SH SYNOPSIS |
| 6 | .B mkimage |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 7 | .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 Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 13 | .RB [\fIoptions\fP] " \-F [" "uimage file name" "]" |
| 14 | |
| 15 | .B mkimage |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 16 | .RB [\fIoptions\fP] " (legacy mode)" |
| 17 | |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 18 | .SH "DESCRIPTION" |
| 19 | The |
| 20 | .B mkimage |
| 21 | command is used to create images for use with the U-Boot boot loader. |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 22 | These images can contain the linux kernel, device tree blob, root file |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 23 | system image, firmware images etc., either separate or combined. |
| 24 | |
| 25 | .B mkimage |
| 26 | supports two different formats: |
| 27 | |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 28 | The old |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 29 | .I legacy image |
| 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, |
| 34 | etc. |
| 35 | |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 36 | The new |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 37 | .I FIT (Flattened Image Tree) format |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 38 | allows for more flexibility in handling images of various types and also |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 39 | enhances integrity protection of images with stronger checksums. It also |
| 40 | supports verified boot. |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 41 | |
| 42 | .SH "OPTIONS" |
| 43 | |
| 44 | .B List image information: |
| 45 | |
| 46 | .TP |
| 47 | .BI "\-l [" "uimage file name" "]" |
| 48 | mkimage 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 Minier | 775648f | 2011-01-04 02:32:36 +0100 | [diff] [blame] | 55 | Set architecture. Pass \-h as the architecture to see the list of supported architectures. |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 56 | |
| 57 | .TP |
| 58 | .BI "\-O [" "os" "]" |
| 59 | Set operating system. bootm command of u-boot changes boot method by os type. |
Loïc Minier | 775648f | 2011-01-04 02:32:36 +0100 | [diff] [blame] | 60 | Pass \-h as the OS to see the list of supported OS. |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 61 | |
| 62 | .TP |
| 63 | .BI "\-T [" "image type" "]" |
| 64 | Set image type. |
Loïc Minier | 775648f | 2011-01-04 02:32:36 +0100 | [diff] [blame] | 65 | Pass \-h as the image to see the list of supported image type. |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 66 | |
| 67 | .TP |
| 68 | .BI "\-C [" "compression type" "]" |
| 69 | Set compression type. |
Loïc Minier | 775648f | 2011-01-04 02:32:36 +0100 | [diff] [blame] | 70 | Pass \-h as the compression to see the list of supported compression type. |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 71 | |
| 72 | .TP |
Jelle van der Waa | 6c90a7d | 2016-09-14 21:54:53 +0200 | [diff] [blame] | 73 | .BI "\-a [" "load address" "]" |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 74 | Set load address with a hex number. |
| 75 | |
| 76 | .TP |
| 77 | .BI "\-e [" "entry point" "]" |
| 78 | Set entry point with a hex number. |
| 79 | |
| 80 | .TP |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 81 | .BI "\-l" |
| 82 | List the contents of an image. |
| 83 | |
| 84 | .TP |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 85 | .BI "\-n [" "image name" "]" |
| 86 | Set image name to 'image name'. |
| 87 | |
| 88 | .TP |
| 89 | .BI "\-d [" "image data file" "]" |
| 90 | Use image data from 'image data file'. |
| 91 | |
| 92 | .TP |
| 93 | .BI "\-x" |
| 94 | Set XIP (execute in place) flag. |
| 95 | |
| 96 | .P |
| 97 | .B Create FIT image: |
| 98 | |
| 99 | .TP |
Andreas Bießmann | f400158 | 2016-05-01 03:01:27 +0200 | [diff] [blame] | 100 | .BI "\-b [" "device tree file" "] |
| 101 | Appends the device tree binary file (.dtb) to the FIT. |
Simon Glass | bd8bc5d | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 102 | |
| 103 | .TP |
Simon Glass | bf27d3d | 2013-06-13 15:10:06 -0700 | [diff] [blame] | 104 | .BI "\-c [" "comment" "]" |
| 105 | Specifies a comment to be added when signing. This is typically a useful |
| 106 | message which describes how the image was signed or some other useful |
| 107 | information. |
| 108 | |
| 109 | .TP |
Horst Kronstorfer | 8878492 | 2011-12-23 05:40:20 +0000 | [diff] [blame] | 110 | .BI "\-D [" "dtc options" "]" |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 111 | Provide special options to the device tree compiler that is used to |
| 112 | create the image. |
| 113 | |
| 114 | .TP |
Simon Glass | afd728c | 2016-02-22 22:55:53 -0700 | [diff] [blame] | 115 | .BI "\-E |
| 116 | After processing, move the image data outside the FIT and store a data offset |
| 117 | in the FIT. Images will be placed one after the other immediately after the |
| 118 | FIT, with each one aligned to a 4-byte boundary. The existing 'data' property |
| 119 | in each image will be replaced with 'data-offset' and 'data-size' properties. |
| 120 | A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned) |
| 121 | byte after the FIT. |
| 122 | |
| 123 | .TP |
Simon Glass | 88e31cb | 2016-02-22 22:55:51 -0700 | [diff] [blame] | 124 | .BI "\-f [" "image tree source file" " | " "auto" "]" |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 125 | Image tree source file that describes the structure and contents of the |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 126 | FIT image. |
| 127 | |
Simon Glass | 88e31cb | 2016-02-22 22:55:51 -0700 | [diff] [blame] | 128 | This can be automatically generated for some simple cases. |
| 129 | Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a |
| 130 | and -e are used to specify the image to include in the FIT and its attributes. |
| 131 | No .its file is required. |
| 132 | |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 133 | .TP |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 134 | .BI "\-F" |
| 135 | Indicates that an existing FIT image should be modified. No dtc |
Vagrant Cascadian | 6736b8b | 2014-11-01 18:09:01 -0700 | [diff] [blame] | 136 | compilation is performed and the \-f flag should not be given. |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 137 | This can be used to sign images with additional keys after initial image |
| 138 | creation. |
| 139 | |
| 140 | .TP |
Tomeu Vizoso | 8d83ed2 | 2016-11-04 14:22:15 +0100 | [diff] [blame] | 141 | .BI "\-i [" "ramdisk_file" "]" |
| 142 | Appends the ramdisk file to the FIT. |
| 143 | |
| 144 | .TP |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 145 | .BI "\-k [" "key_directory" "]" |
| 146 | Specifies the directory containing keys to use for signing. This directory |
| 147 | should contain a private key file <name>.key for use with signing and a |
| 148 | certificate <name>.crt (containing the public key) for use with verification. |
| 149 | |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 150 | .TP |
| 151 | .BI "\-K [" "key_destination" "]" |
| 152 | Specifies a compiled device tree binary file (typically .dtb) to write |
| 153 | public key information into. When a private key is used to sign an image, |
| 154 | the corresponding public key is written into this file for for run-time |
| 155 | verification. Typically the file here is the device tree binary used by |
| 156 | CONFIG_OF_CONTROL in U-Boot. |
| 157 | |
Simon Glass | 817278a | 2013-06-13 15:10:07 -0700 | [diff] [blame] | 158 | .TP |
Jan Kiszka | 4043f32 | 2022-01-14 10:21:19 +0100 | [diff] [blame] | 159 | .BI "\-o [" "signing algorithm" "]" |
| 160 | Specifies the algorithm to be used for signing a FIT image. The default is |
| 161 | taken from the target signature nodes 'algo' properties. |
| 162 | |
| 163 | .TP |
Teddy Reed | a845762 | 2016-06-09 19:38:02 -0700 | [diff] [blame] | 164 | .BI "\-p [" "external position" "]" |
| 165 | Place external data at a static external position. See \-E. Instead of writing |
| 166 | a 'data-offset' property defining the offset from the end of the FIT, \-p will |
| 167 | use 'data-position' as the absolute position from the base of the FIT. |
| 168 | |
| 169 | .TP |
Simon Glass | 817278a | 2013-06-13 15:10:07 -0700 | [diff] [blame] | 170 | .BI "\-r |
| 171 | Specifies that keys used to sign the FIT are required. This means that they |
| 172 | must be verified for the image to boot. Without this option, the verification |
| 173 | will be optional (useful for testing but not for release). |
| 174 | |
Simon Glass | 472ee0c | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 175 | .TP |
| 176 | .BI "\-t |
| 177 | Update the timestamp in the FIT. |
| 178 | |
| 179 | Normally the FIT timestamp is created the first time mkimage is run on a FIT, |
| 180 | when converting the source .its to the binary .fit file. This corresponds to |
| 181 | using the -f flag. But if the original input to mkimage is a binary file |
| 182 | (already compiled) then the timestamp is assumed to have been set previously. |
| 183 | |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 184 | .SH EXAMPLES |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 185 | |
| 186 | List image information: |
| 187 | .nf |
| 188 | .B mkimage -l uImage |
| 189 | .fi |
| 190 | .P |
| 191 | Create legacy image with compressed PowerPC Linux kernel: |
| 192 | .nf |
| 193 | .B mkimage -A powerpc -O linux -T kernel -C gzip \\\\ |
| 194 | .br |
| 195 | .B -a 0 -e 0 -n Linux -d vmlinux.gz uImage |
| 196 | .fi |
| 197 | .P |
| 198 | Create FIT image with compressed PowerPC Linux kernel: |
| 199 | .nf |
| 200 | .B mkimage -f kernel.its kernel.itb |
| 201 | .fi |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 202 | .P |
| 203 | Create FIT image with compressed kernel and sign it with keys in the |
| 204 | /public/signing-keys directory. Add corresponding public keys into u-boot.dtb, |
| 205 | skipping those for which keys cannot be found. Also add a comment. |
| 206 | .nf |
| 207 | .B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\ |
Vagrant Cascadian | 6736b8b | 2014-11-01 18:09:01 -0700 | [diff] [blame] | 208 | .br |
Simon Glass | 1c57023 | 2016-02-22 22:55:49 -0700 | [diff] [blame] | 209 | .B -c """Kernel 3.8 image for production devices""" kernel.itb |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 210 | .fi |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 211 | |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 212 | .P |
| 213 | Update an existing FIT image, signing it with additional keys. |
| 214 | Add corresponding public keys into u-boot.dtb. This will resign all images |
| 215 | with keys that are available in the new directory. Images that request signing |
| 216 | with unavailable keys are skipped. |
| 217 | .nf |
| 218 | .B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\ |
Vagrant Cascadian | 6736b8b | 2014-11-01 18:09:01 -0700 | [diff] [blame] | 219 | .br |
Simon Glass | 1c57023 | 2016-02-22 22:55:49 -0700 | [diff] [blame] | 220 | .B -c """Kernel 3.8 image for production devices""" kernel.itb |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 221 | .fi |
| 222 | |
Simon Glass | 88e31cb | 2016-02-22 22:55:51 -0700 | [diff] [blame] | 223 | .P |
| 224 | Create a FIT image containing a kernel, using automatic mode. No .its file |
| 225 | is required. |
| 226 | .nf |
| 227 | .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\ |
| 228 | .br |
| 229 | .B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb |
| 230 | .fi |
Simon Glass | bd8bc5d | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 231 | .P |
| 232 | Create a FIT image containing a kernel and some device tree files, using |
| 233 | automatic mode. No .its file is required. |
| 234 | .nf |
| 235 | .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\ |
| 236 | .br |
| 237 | .B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\ |
Andreas Bießmann | f400158 | 2016-05-01 03:01:27 +0200 | [diff] [blame] | 238 | .B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb |
Simon Glass | bd8bc5d | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 239 | .fi |
Simon Glass | 88e31cb | 2016-02-22 22:55:51 -0700 | [diff] [blame] | 240 | |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 241 | .SH HOMEPAGE |
| 242 | http://www.denx.de/wiki/U-Boot/WebHome |
| 243 | .PP |
| 244 | .SH AUTHOR |
| 245 | This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 246 | and Wolfgang Denk <wd@denx.de>. It was updated for image signing by |
| 247 | Simon Glass <sjg@chromium.org>. |