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