mkimage.1 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 "\-p [" "external position" "]"
  126. Place external data at a static external position. See \-E. Instead of writing
  127. a 'data-offset' property defining the offset from the end of the FIT, \-p will
  128. use 'data-position' as the absolute position from the base of the FIT.
  129. .TP
  130. .BI "\-r
  131. Specifies that keys used to sign the FIT are required. This means that they
  132. must be verified for the image to boot. Without this option, the verification
  133. will be optional (useful for testing but not for release).
  134. .SH EXAMPLES
  135. List image information:
  136. .nf
  137. .B mkimage -l uImage
  138. .fi
  139. .P
  140. Create legacy image with compressed PowerPC Linux kernel:
  141. .nf
  142. .B mkimage -A powerpc -O linux -T kernel -C gzip \\\\
  143. .br
  144. .B -a 0 -e 0 -n Linux -d vmlinux.gz uImage
  145. .fi
  146. .P
  147. Create FIT image with compressed PowerPC Linux kernel:
  148. .nf
  149. .B mkimage -f kernel.its kernel.itb
  150. .fi
  151. .P
  152. Create FIT image with compressed kernel and sign it with keys in the
  153. /public/signing-keys directory. Add corresponding public keys into u-boot.dtb,
  154. skipping those for which keys cannot be found. Also add a comment.
  155. .nf
  156. .B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\
  157. .br
  158. .B -c """Kernel 3.8 image for production devices""" kernel.itb
  159. .fi
  160. .P
  161. Update an existing FIT image, signing it with additional keys.
  162. Add corresponding public keys into u-boot.dtb. This will resign all images
  163. with keys that are available in the new directory. Images that request signing
  164. with unavailable keys are skipped.
  165. .nf
  166. .B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\
  167. .br
  168. .B -c """Kernel 3.8 image for production devices""" kernel.itb
  169. .fi
  170. .P
  171. Create a FIT image containing a kernel, using automatic mode. No .its file
  172. is required.
  173. .nf
  174. .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
  175. .br
  176. .B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb
  177. .fi
  178. .P
  179. Create a FIT image containing a kernel and some device tree files, using
  180. automatic mode. No .its file is required.
  181. .nf
  182. .B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\
  183. .br
  184. .B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\
  185. .B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb
  186. .fi
  187. .SH HOMEPAGE
  188. http://www.denx.de/wiki/U-Boot/WebHome
  189. .PP
  190. .SH AUTHOR
  191. This manual page was written by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  192. and Wolfgang Denk <wd@denx.de>. It was updated for image signing by
  193. Simon Glass <sjg@chromium.org>.