imxtract.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. .. SPDX-License-Identifier: GPL-2.0+:
  2. imxtract command
  3. ================
  4. Synopsis
  5. --------
  6. ::
  7. imxtract addr part [dest]
  8. imxtract addr uname [dest]
  9. Description
  10. -----------
  11. The imxtract command is used to extract a part of a multi-image file.
  12. Two different file formats are supported:
  13. * FIT images
  14. * legacy U-Boot images
  15. addr
  16. Address of the multi-image file from which a part shall be extracted
  17. part
  18. Index (hexadecimal) of the part of a legacy U-Boot image to be extracted
  19. uname
  20. Name of the part of a FIT image to be extracted
  21. dest
  22. Destination address (defaults to 0x0)
  23. The value of environment variable *verify* controls if the hashes and
  24. signatures of FIT images or the check sums of legacy U-Boot images are checked.
  25. To enable checking set *verify* to one of the values *1*, *yes*, *true*.
  26. (Actually only the first letter is checked disregarding the case.)
  27. To list the parts of an image the *iminfo* command can be used.
  28. Examples
  29. --------
  30. With verify=no incorrect hashes, signatures, or check sums don't stop the
  31. extraction. But correct hashes are still indicated in the output
  32. (here: md5, sha1).
  33. .. code-block:: console
  34. => setenv verify no
  35. => imxtract $loadaddr kernel-1 $kernel_addr_r
  36. ## Copying 'kernel-1' subimage from FIT image at 40200000 ...
  37. md5+ sha1+ Loading part 0 ... OK
  38. =>
  39. With verify=yes incorrect hashes, signatures, or check sums stop the extraction.
  40. .. code-block:: console
  41. => setenv verify yes
  42. => imxtract $loadaddr kernel-1 $kernel_addr_r
  43. ## Copying 'kernel-1' subimage from FIT image at 40200000 ...
  44. md5 error!
  45. Bad hash value for 'hash-1' hash node in 'kernel-1' image node
  46. Bad Data Hash
  47. =>
  48. Configuration
  49. -------------
  50. The imxtract command is only available if CONFIG_CMD_XIMG=y. Support for FIT
  51. images requires CONFIG_FIT=y. Support for legacy U-Boot images requires
  52. CONFIG_LEGACY_IMAGE_FORMAT=y.
  53. Return value
  54. ------------
  55. On success the return value $? of the command is 0 (true). On failure the
  56. return value is 1 (false).