aboutsummaryrefslogtreecommitdiff
path: root/tools/fit_common.c
diff options
context:
space:
mode:
authorStefan Eichenberger <eichest@gmail.com>2022-01-10 18:48:32 +0100
committerTom Rini <trini@konsulko.com>2022-01-24 10:35:10 -0500
commit6f08eee67fe93068ab501cc5f3094e480e76f4a9 (patch)
tree98bd2ec2223c89401d6a99b0d3f2ec05d2e84e41 /tools/fit_common.c
parent5390cafed8858c8f9096131f2c2ddb2698931d2d (diff)
downloadu-boot-6f08eee67fe93068ab501cc5f3094e480e76f4a9.zip
u-boot-6f08eee67fe93068ab501cc5f3094e480e76f4a9.tar.gz
u-boot-6f08eee67fe93068ab501cc5f3094e480e76f4a9.tar.bz2
tools/fitimage: make sure dumpimage still works when "@" are detected
fit_verify_header fails if it detects unit addresses "@". However, this will break tools like dumpimage on fit images which worked with previous versions of the tool (e.g. 2020.04 vs 2021.07). As an example the output of: dumpimage -l <fit image> is: FIT description: U-Boot fitImage for Linux Distribution Created: Thu Jan 1 01:00:00 1970 Image 0 (kernel@1) Description: Linux kernel Created: Thu Jan 1 01:00:00 1970 Type: Kernel Image Compression: gzip compressed Data Size: 6442456 Bytes = 6291.46 KiB = 6.14 MiB Architecture: AArch64 OS: Linux Load Address: 0x80080000 Entry Point: 0x80080000 Hash algo: sha256 Hash value: ... Image 1 (fdt@freescale_fsl-s32g274a-evb.dtb) Description: Flattened Device Tree blob Created: Thu Jan 1 01:00:00 1970 Type: Flat Device Tree Compression: uncompressed Data Size: 39661 Bytes = 38.73 KiB = 0.04 MiB Architecture: AArch64 Hash algo: sha256 Hash value: ... Default Configuration: 'conf@freescale_fsl-s32g274a-evb.dtb' Configuration 0 (conf@freescale_fsl-s32g274a-evb.dtb) Description: 1 Linux kernel, FDT blob Kernel: kernel@1 FDT: fdt@freescale_fsl-s32g274a-evb.dtb Hash algo: sha256 Hash value: unavailable But with newer version it shows: dumpimage -l <fit image> GP Header: Size d00dfeed LoadAddr 62f0a4 This commit will output a warning that unit addresses were detected but will not fail: dumpimage -l <fit image> Image contains unit addresses @, this will break signing ... Signed-off-by: Stefan Eichenberger <eichest@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/fit_common.c')
-rw-r--r--tools/fit_common.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/fit_common.c b/tools/fit_common.c
index 52b6329..5c8920d 100644
--- a/tools/fit_common.c
+++ b/tools/fit_common.c
@@ -26,10 +26,18 @@
int fit_verify_header(unsigned char *ptr, int image_size,
struct image_tool_params *params)
{
- if (fdt_check_header(ptr) != EXIT_SUCCESS ||
- fit_check_format(ptr, IMAGE_SIZE_INVAL))
+ int ret;
+
+ if (fdt_check_header(ptr) != EXIT_SUCCESS)
return EXIT_FAILURE;
+ ret = fit_check_format(ptr, IMAGE_SIZE_INVAL);
+ if (ret) {
+ if (ret != -EADDRNOTAVAIL)
+ return EXIT_FAILURE;
+ fprintf(stderr, "Image contains unit addresses @, this will break signing\n");
+ }
+
return EXIT_SUCCESS;
}