blob: 235d15e445b07df31068dc470d46ee0fed0c27c6 [file] [log] [blame]
Heinrich Schuchardt170b4af2023-06-13 21:02:01 +02001.. SPDX-License-Identifier: GPL-2.0+:
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: imxtract (command)
5
Heinrich Schuchardt170b4af2023-06-13 21:02:01 +02006imxtract command
7================
8
9Synopsis
10--------
11
12::
13
14 imxtract addr part [dest]
15 imxtract addr uname [dest]
16
17Description
18-----------
19
20The imxtract command is used to extract a part of a multi-image file.
21
22Two different file formats are supported:
23
24* FIT images
25* legacy U-Boot images
26
27addr
28 Address of the multi-image file from which a part shall be extracted
29
30part
31 Index (hexadecimal) of the part of a legacy U-Boot image to be extracted
32
33uname
34 Name of the part of a FIT image to be extracted
35
36dest
37 Destination address (defaults to 0x0)
38
39The value of environment variable *verify* controls if the hashes and
40signatures of FIT images or the check sums of legacy U-Boot images are checked.
41To enable checking set *verify* to one of the values *1*, *yes*, *true*.
42(Actually only the first letter is checked disregarding the case.)
43
44To list the parts of an image the *iminfo* command can be used.
45
46Examples
47--------
48
49With verify=no incorrect hashes, signatures, or check sums don't stop the
50extraction. But correct hashes are still indicated in the output
Sean Anderson72a09cc2023-12-02 14:33:14 -050051(here: sha256, sha512).
Heinrich Schuchardt170b4af2023-06-13 21:02:01 +020052
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 Anderson72a09cc2023-12-02 14:33:14 -050058 sha256+ sha512+ Loading part 0 ... OK
Heinrich Schuchardt170b4af2023-06-13 21:02:01 +020059 =>
60
61With 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 Anderson72a09cc2023-12-02 14:33:14 -050068 sha256 error!
Heinrich Schuchardt170b4af2023-06-13 21:02:01 +020069 Bad hash value for 'hash-1' hash node in 'kernel-1' image node
70 Bad Data Hash
71 =>
72
73Configuration
74-------------
75
76The imxtract command is only available if CONFIG_CMD_XIMG=y. Support for FIT
77images requires CONFIG_FIT=y. Support for legacy U-Boot images requires
78CONFIG_LEGACY_IMAGE_FORMAT=y.
79
80Return value
81------------
82
83On success the return value $? of the command is 0 (true). On failure the
84return value is 1 (false).