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