mkimage.1 7.2 KB

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