summaryrefslogtreecommitdiff
path: root/tools/imagetool.h
diff options
context:
space:
mode:
authorJordan Hand <jordanhand22@gmail.com>2019-03-06 01:47:56 +0300
committerTom Rini <trini@konsulko.com>2019-03-08 19:31:44 +0300
commitd32aa3cae44e618048ff7f378577d44f9b6d6dcc (patch)
treefc4cfbe78b9629281ee4a8c1ccead9204afa9224 /tools/imagetool.h
parent280fafff165428bc69db221faaccaf4edfc32d9d (diff)
downloadu-boot-d32aa3cae44e618048ff7f378577d44f9b6d6dcc.tar.xz
fdt: Fix FIT header verification in mkimage and conduct same checks as bootm
FIT header verification in mkimage was treating a return code as a boolean, which meant that failures in validating the fit were seen as successes. Additionally, mkimage was checking all formats to find a header which passes validation, rather than using the image type specified to mkimage. checkpatch.pl checks for lines ending with '(' and alignment matching open parentheses are ignored to keep with existing coding style. Signed-off-by: Jordan Hand <jorhand@microsoft.com>
Diffstat (limited to 'tools/imagetool.h')
-rw-r--r--tools/imagetool.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/imagetool.h b/tools/imagetool.h
index 71471420f9..2689a4004a 100644
--- a/tools/imagetool.h
+++ b/tools/imagetool.h
@@ -179,6 +179,25 @@ int imagetool_verify_print_header(
struct image_type_params *tparams,
struct image_tool_params *params);
+/*
+ * imagetool_verify_print_header_by_type() - verifies the image header
+ *
+ * Verify the image_header for the image type given by tparams.
+ * If verification is successful, this prints the respective header.
+ * @ptr: pointer the the image header
+ * @sbuf: stat information about the file pointed to by ptr
+ * @tparams: image type parameters
+ * @params: mkimage parameters
+ *
+ * @return 0 on success, negative if input image format does not match with
+ * the given image type
+ */
+int imagetool_verify_print_header_by_type(
+ void *ptr,
+ struct stat *sbuf,
+ struct image_type_params *tparams,
+ struct image_tool_params *params);
+
/**
* imagetool_save_subimage - store data into a file
* @file_name: name of the destination file