Pali Rohár | cdf0d1c | 2022-02-13 01:09:46 +0100 | [diff] [blame] | 1 | .TH MKIMAGE 1 "2022-02-07" |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 2 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 3 | .SH NAME |
Sean Anderson | 9ed02c0 | 2022-06-25 13:12:14 -0400 | [diff] [blame] | 4 | mkimage \- generate images for U-Boot |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 5 | .SH SYNOPSIS |
Sean Anderson | 9028386 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 6 | .SY mkimage |
| 7 | .OP \-T type |
| 8 | .BI \-l\~ image-file-name |
| 9 | .YS |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 10 | . |
Sean Anderson | 9028386 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 11 | .SY mkimage |
| 12 | .RI [ option\~ .\|.\|.\&] |
| 13 | .OP \-T type |
| 14 | .I image-file-name |
| 15 | .YS |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 16 | . |
Sean Anderson | 9028386 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 17 | .SY mkimage |
| 18 | .RI [ option\~ .\|.\|.\&] |
| 19 | .BI \-f\~ image-tree-source-file\c |
| 20 | .RB | auto |
| 21 | .I image-file-name |
| 22 | .YS |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 23 | . |
Sean Anderson | 9028386 | 2022-06-25 13:12:08 -0400 | [diff] [blame] | 24 | .SY mkimage |
| 25 | .RI [ option\~ .\|.\|.\&] |
| 26 | .BI \-F\~ image-file-name |
| 27 | .YS |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 28 | . |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 29 | .SH DESCRIPTION |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 30 | The |
| 31 | .B mkimage |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 35 | .P |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 36 | .B mkimage |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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 |
| 39 | other kernel): |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 40 | .P |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 45 | .P |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 46 | The new |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 47 | .I FIT |
| 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 51 | . |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 52 | .SH OPTIONS |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 53 | . |
Sean Anderson | 41b1ca9 | 2022-06-25 13:12:12 -0400 | [diff] [blame] | 54 | .SS General options |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 55 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 56 | .TP |
Sean Anderson | e4045c0 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 57 | .B \-h |
| 58 | Print a help message and exit. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 59 | . |
Pali Rohár | cdf0d1c | 2022-02-13 01:09:46 +0100 | [diff] [blame] | 60 | .TP |
Sean Anderson | e4045c0 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 61 | .B \-l |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 62 | .B mkimage |
| 63 | lists the information contained in the header of an existing U-Boot image. |
Sean Anderson | e4045c0 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 64 | . |
| 65 | .TP |
| 66 | .B \-s |
| 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. |
| 69 | . |
| 70 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 71 | .BI \-T " image-type" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 72 | Parse image file as |
| 73 | .IR image-type . |
| 74 | Pass |
| 75 | .B list |
| 76 | as |
| 77 | .I image-type |
| 78 | to see the list of supported image types. If this option is absent, then it |
| 79 | defaults to |
| 80 | .B kernel |
| 81 | (legacy image). If this option is absent when |
| 82 | .B \-l |
| 83 | is passed, then |
| 84 | .B mkimage |
| 85 | will attempt to automatically detect the image type. Not all image types support |
| 86 | automatic detection, so it may be necessary to pass |
| 87 | .B \-T |
| 88 | explicitly. |
| 89 | .IP |
| 90 | When creating a FIT image with |
| 91 | .BR \-f , |
| 92 | the image type is always set to |
| 93 | .BR flat_dt . |
| 94 | In this case, |
| 95 | .B \-T |
| 96 | specifies the image node's \(oqtype\(cq property. If |
| 97 | .B \-T |
| 98 | is absent, then the \(oqtype\(cq property will default to |
| 99 | .BR kernel . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 100 | . |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 101 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 102 | .B \-q |
Sean Anderson | e4045c0 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 103 | Quiet. Don't print the image header. |
| 104 | . |
| 105 | .TP |
| 106 | .B \-v |
| 107 | Verbose. Print file names as they are added to the image. |
| 108 | . |
| 109 | .TP |
| 110 | .B \-V |
| 111 | Print version information and exit. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 112 | . |
Sean Anderson | 41b1ca9 | 2022-06-25 13:12:12 -0400 | [diff] [blame] | 113 | .SS General image-creation options |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 114 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 115 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 116 | .BI \-A " architecture" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 117 | Set the architecture. Pass |
| 118 | .B \-h |
| 119 | as the architecture to see the list of supported architectures. If |
| 120 | .B \-A |
| 121 | is absent, it defaults to |
| 122 | .BR ppc . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 123 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 124 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 125 | .BI \-O " os" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 126 | Set the operating system. The U-Boot |
| 127 | .I bootm |
| 128 | command changes boot method based on the OS type. |
| 129 | Pass |
| 130 | .B \-h |
| 131 | as the |
| 132 | .I os |
| 133 | to see the list of supported OSs. If |
| 134 | .B \-O |
| 135 | is absent, it defaults to |
| 136 | .BR linux . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 137 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 138 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 139 | .BI \-C " compression-type" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 140 | Set the compression type. The image data should have already been compressed |
| 141 | using this compression type. |
| 142 | .B mkimage |
| 143 | will not automatically compress image data. |
| 144 | Pass |
| 145 | .B \-h |
| 146 | as the |
| 147 | .I compression-type |
| 148 | to see the list of supported compression types. If |
| 149 | .B \-C |
| 150 | is absent, it defaults to |
| 151 | .BR gzip . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 152 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 153 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 154 | .BI \-a " load-address" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 155 | Set the absolute address to load the image data to. |
| 156 | .I load-address |
| 157 | will be interpreted as a hexadecimal number. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 158 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 159 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 160 | .BI \-e " entry-point" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 161 | Set the absolute address of the image entry point. The U-Boot |
| 162 | .I bootm |
| 163 | command will jump to this address after loading the image. |
| 164 | .I entry-point |
| 165 | will be interpreted as a hexadecimal number. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 166 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 167 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 168 | .BI \-n " image-name" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 169 | Set the image name to |
| 170 | .IR image-name . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 171 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 172 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 173 | .BI \-R " secondary-image-name" |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 174 | Some image types support a second image for additional data. For these types, |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 175 | use |
| 176 | .B \-R |
| 177 | to specify this second image. |
Sean Anderson | 021e2db | 2022-05-16 16:11:07 -0400 | [diff] [blame] | 178 | .TS |
| 179 | allbox; |
| 180 | lb lbx |
| 181 | l l. |
| 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 |
| 186 | .sp |
| 187 | .ti 4 |
| 188 | .I address data |
| 189 | .sp |
| 190 | where |
| 191 | .I address |
| 192 | and |
| 193 | .I data |
| 194 | are hexadecimal integers. The boot ROM will write each |
| 195 | .I data |
| 196 | to |
| 197 | .I address |
| 198 | when loading the image. At most 256 parameters may be specified in this |
| 199 | manner. |
| 200 | T} |
| 201 | .TE |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 202 | . |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 203 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 204 | .BI \-d " image-data-file" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 205 | Use image data from |
| 206 | .IR image-data-file . |
| 207 | If the |
| 208 | .I image-type |
| 209 | is |
| 210 | .BR multi , |
| 211 | then multiple images may be specified, separated by colons: |
| 212 | .RS |
| 213 | .IP |
| 214 | .IR image-data-file [\fB:\fP image-data-file .\|.\|.] |
| 215 | .RE |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 216 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 217 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 218 | .B \-x |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 219 | Set the |
| 220 | .I XIP |
| 221 | (execute in place) flag. The U-Boot |
| 222 | .I bootm |
| 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). |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 225 | . |
Sean Anderson | 41b1ca9 | 2022-06-25 13:12:12 -0400 | [diff] [blame] | 226 | .SS Options for creating FIT images |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 227 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 228 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 229 | .BI \-b " device-tree-file" |
Andreas Bießmann | f400158 | 2016-05-01 03:01:27 +0200 | [diff] [blame] | 230 | Appends the device tree binary file (.dtb) to the FIT. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 231 | . |
Simon Glass | bd8bc5d | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 232 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 233 | .BI \-c " comment" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 236 | . |
Simon Glass | bf27d3d | 2013-06-13 15:10:06 -0700 | [diff] [blame] | 237 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 238 | .BI \-D " dtc-options" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 239 | Provide additional options to the device tree compiler when creating the image. |
| 240 | See |
| 241 | .BR dtc (1) |
| 242 | for documentation of possible options. If |
| 243 | .B \-D |
| 244 | is absent, it defaults to |
| 245 | .BR "\-I dts \-O dtb \-p 500" . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 246 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 247 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 248 | .BI \-E |
Simon Glass | afd728c | 2016-02-22 22:55:53 -0700 | [diff] [blame] | 249 | After processing, move the image data outside the FIT and store a data offset |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 255 | . |
Simon Glass | afd728c | 2016-02-22 22:55:53 -0700 | [diff] [blame] | 256 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 257 | .BI \-B " alignment" |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 258 | The alignment, in hexadecimal, that external data will be aligned to. This |
| 259 | option only has an effect when \-E is specified. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 260 | . |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 261 | .TP |
Sean Anderson | e4045c0 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 262 | .BI \-p " external-position" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 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, |
| 265 | .B \-p |
| 266 | will use \(oqdata-position\(cq as the absolute position from the base of the |
| 267 | FIT. See |
| 268 | .B \-E |
| 269 | for details on using external data. |
Sean Anderson | e4045c0 | 2022-06-25 13:12:13 -0400 | [diff] [blame] | 270 | . |
| 271 | .TP |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 272 | \fB\-f \fIimage-tree-source-file\fR | \fBauto |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 273 | Image tree source file that describes the structure and contents of the |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 274 | FIT image. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 275 | .IP |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 276 | In some simple cases, the image tree source can be generated automatically. To |
| 277 | use this feature, pass |
| 278 | .BR "\-f auto" . |
| 279 | The |
| 280 | .BR \-d , |
| 281 | .BR \-A , |
| 282 | .BR \-O , |
| 283 | .BR \-T , |
| 284 | .BR \-C , |
| 285 | .BR \-a , |
| 286 | and |
| 287 | .B \-e |
| 288 | options may be used to specify the image to include in the FIT and its |
| 289 | attributes. No |
| 290 | .I image-tree-source-file |
| 291 | is required. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 292 | . |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 293 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 294 | .B \-F |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 295 | Indicates that an existing FIT image should be modified. No dtc compilation will |
| 296 | be performed and |
| 297 | .B \-f |
| 298 | should not be passed. This can be used to sign images with additional keys |
| 299 | after initial image creation. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 300 | . |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 301 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 302 | .BI \-i " ramdisk-file" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 303 | Append a ramdisk or initramfs file to the image. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 304 | . |
Tomeu Vizoso | 8d83ed2 | 2016-11-04 14:22:15 +0100 | [diff] [blame] | 305 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 306 | .BI \-k " key-directory" |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 307 | Specifies the directory containing keys to use for signing. This directory |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 308 | should contain a private key file |
| 309 | .IR name .key |
| 310 | for use with signing, and a certificate |
| 311 | .IR name .crt |
| 312 | (containing the public key) for use with verification. The public key is only |
| 313 | necessary when embedding it into another device tree using |
| 314 | .BR \-K . |
| 315 | .I name |
| 316 | defaults to the value of the signature node's \(oqkey-name-hint\(cq property, |
| 317 | but may be overridden using |
| 318 | .BR \-g . |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 319 | . |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 320 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 321 | .BI \-G " key-file" |
Sean Anderson | 021e2db | 2022-05-16 16:11:07 -0400 | [diff] [blame] | 322 | Specifies the private key file to use when signing. This option may be used |
| 323 | instead of \-k. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 324 | . |
Sean Anderson | 021e2db | 2022-05-16 16:11:07 -0400 | [diff] [blame] | 325 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 326 | .BI \-K " key-destination" |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 332 | . |
Simon Glass | 817278a | 2013-06-13 15:10:07 -0700 | [diff] [blame] | 333 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 334 | .BI \-g " key-name-hint" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 335 | Overrides the signature node's \(oqkey-name-hint\(cq property. This is |
| 336 | especially useful when signing an image with |
| 337 | .BR "\-f auto" . |
| 338 | This is the |
| 339 | .I name |
| 340 | part of the key. The directory part is set by |
| 341 | .BR \-k . |
| 342 | This option also indicates that the images included in the FIT should be signed. |
| 343 | If this option is specified, then |
| 344 | .B \-o |
| 345 | must be specified as well. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 346 | . |
Sean Anderson | 5f15029 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 347 | .TP |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 348 | .BI \-o " crypto" , checksum |
Jan Kiszka | 4043f32 | 2022-01-14 10:21:19 +0100 | [diff] [blame] | 349 | Specifies the algorithm to be used for signing a FIT image. The default is |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 350 | taken from the signature node's \(oqalgo\(cq property. |
| 351 | The valid values for |
| 352 | .I crypto |
| 353 | are: |
| 354 | .RS |
| 355 | .IP |
| 356 | .TS |
| 357 | lb. |
| 358 | rsa2048 |
| 359 | rsa3072 |
| 360 | rsa4096 |
| 361 | ecdsa256 |
| 362 | .TE |
| 363 | .RE |
| 364 | .IP |
| 365 | The valid values for |
| 366 | .I checksum |
| 367 | are |
| 368 | .RS |
| 369 | .IP |
| 370 | .TS |
| 371 | lb. |
| 372 | sha1 |
| 373 | sha256 |
| 374 | sha384 |
| 375 | sha512 |
| 376 | .TE |
| 377 | .RE |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 378 | . |
Jan Kiszka | 4043f32 | 2022-01-14 10:21:19 +0100 | [diff] [blame] | 379 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 380 | .B \-r |
Simon Glass | 817278a | 2013-06-13 15:10:07 -0700 | [diff] [blame] | 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). |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 384 | . |
Simon Glass | 472ee0c | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 385 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 386 | .BI \-N " engine" |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 387 | The openssl engine to use when signing and verifying the image. For a complete |
| 388 | list of available engines, refer to |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 389 | .BR engine (1). |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 390 | . |
Sean Anderson | 138d271 | 2022-04-08 16:08:39 -0400 | [diff] [blame] | 391 | .TP |
Sean Anderson | d72a059 | 2022-06-25 13:12:11 -0400 | [diff] [blame] | 392 | .B \-t |
Simon Glass | 472ee0c | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 393 | Update the timestamp in the FIT. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 394 | .IP |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 395 | Normally the FIT timestamp is created the first time mkimage runs, |
Simon Glass | 472ee0c | 2020-07-09 18:39:43 -0600 | [diff] [blame] | 396 | when converting the source .its to the binary .fit file. This corresponds to |
Sean Anderson | 5f3aa38 | 2022-06-25 13:12:15 -0400 | [diff] [blame] | 397 | using |
| 398 | .BR -f . |
| 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. |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 401 | . |
Sean Anderson | 5e5d9b5 | 2022-06-25 13:12:16 -0400 | [diff] [blame] | 402 | .SH BUGS |
| 403 | Please report bugs to the |
| 404 | .UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues |
| 405 | U-Boot bug tracker |
| 406 | .UE . |
Horst Kronstorfer | e6b37cf | 2011-12-21 04:31:23 +0000 | [diff] [blame] | 407 | .SH EXAMPLES |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 408 | .\" Reduce the width of the tab stops to something reasonable |
| 409 | .ta T 1i |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 410 | List image information: |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 411 | .RS |
| 412 | .P |
| 413 | .EX |
| 414 | \fBmkimage \-l uImage |
| 415 | .EE |
| 416 | .RE |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 417 | .P |
| 418 | Create legacy image with compressed PowerPC Linux kernel: |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 419 | .RS |
| 420 | .P |
| 421 | .EX |
| 422 | \fBmkimage \-A powerpc \-O linux \-T kernel \-C gzip \\ |
| 423 | \-a 0 \-e 0 \-n Linux \-d vmlinux.gz uImage |
| 424 | .EE |
| 425 | .RE |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 426 | .P |
| 427 | Create FIT image with compressed PowerPC Linux kernel: |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 428 | .RS |
| 429 | .P |
| 430 | .EX |
| 431 | \fBmkimage \-f kernel.its kernel.itb |
| 432 | .EE |
| 433 | .RE |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 434 | .P |
| 435 | Create FIT image with compressed kernel and sign it with keys in the |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 436 | /public/signing\-keys directory. Add corresponding public keys into u\-boot.dtb, |
Simon Glass | b4d8b09 | 2013-06-13 15:10:04 -0700 | [diff] [blame] | 437 | skipping those for which keys cannot be found. Also add a comment. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 438 | .RS |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 439 | .P |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 440 | .EX |
| 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 |
| 443 | .EE |
| 444 | .RE |
| 445 | .P |
| 446 | Add public keys to u\-boot.dtb without needing a FIT to sign. This will also |
Sean Anderson | 5f15029 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 447 | create a FIT containing an images node with no data named unused.itb. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 448 | .RS |
| 449 | .P |
| 450 | .EX |
| 451 | \fBmkimage \-f auto \-d /dev/null \-k /public/signing\-keys \-g dev \\ |
| 452 | \-o sha256,rsa2048 \-K u\-boot.dtb unused.itb |
| 453 | .EE |
| 454 | .RE |
Sean Anderson | 5f15029 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 455 | .P |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 456 | Update an existing FIT image, signing it with additional keys. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 457 | Add corresponding public keys into u\-boot.dtb. This will resign all images |
Simon Glass | ce8c3ca | 2013-06-13 15:10:05 -0700 | [diff] [blame] | 458 | with keys that are available in the new directory. Images that request signing |
| 459 | with unavailable keys are skipped. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 460 | .RS |
| 461 | .P |
| 462 | .EX |
| 463 | \fBmkimage \-F \-k /secret/signing\-keys \-K u\-boot.dtb \\ |
| 464 | \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb |
| 465 | .EE |
| 466 | .RE |
Simon Glass | 88e31cb | 2016-02-22 22:55:51 -0700 | [diff] [blame] | 467 | .P |
| 468 | Create a FIT image containing a kernel, using automatic mode. No .its file |
| 469 | is required. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 470 | .RS |
| 471 | .P |
| 472 | .EX |
| 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 |
| 475 | .EE |
| 476 | .RE |
Simon Glass | bd8bc5d | 2016-02-22 22:55:52 -0700 | [diff] [blame] | 477 | .P |
| 478 | Create a FIT image containing a kernel and some device tree files, using |
| 479 | automatic mode. No .its file is required. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 480 | .RS |
| 481 | .P |
| 482 | .EX |
| 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 |
| 486 | .EE |
| 487 | .RE |
Sean Anderson | 5f15029 | 2022-05-16 16:11:08 -0400 | [diff] [blame] | 488 | .P |
| 489 | Create a FIT image containing a signed kernel, using automatic mode. No .its |
| 490 | file is required. |
Sean Anderson | 0575794 | 2022-06-25 13:12:10 -0400 | [diff] [blame] | 491 | .RS |
| 492 | .P |
| 493 | .EX |
| 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 |
| 496 | .EE |
| 497 | .RE |
Sean Anderson | 0d86273 | 2022-06-25 13:12:09 -0400 | [diff] [blame] | 498 | . |
Nobuhiro Iwamatsu | 9711cf6 | 2010-06-16 10:38:24 +0900 | [diff] [blame] | 499 | .PP |
| 500 | .SH AUTHOR |
| 501 | This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
Simon Glass | b148974 | 2013-06-13 15:10:03 -0700 | [diff] [blame] | 502 | and Wolfgang Denk <wd@denx.de>. It was updated for image signing by |
| 503 | Simon Glass <sjg@chromium.org>. |
Sean Anderson | 0707c98 | 2022-06-25 13:12:17 -0400 | [diff] [blame^] | 504 | .SH SEE ALSO |
| 505 | .BR dtc (1), |
| 506 | .BR dumpimage (1), |
| 507 | .BR openssl (1), |
| 508 | the\~ |
| 509 | .UR https://\:u-boot\:.readthedocs\:.io/\:en/\:latest/\:index.html |
| 510 | U-Boot documentation |
| 511 | .UE |