diff options
author | Jordan Hand | 2019-03-05 14:47:56 -0800 |
---|---|---|
committer | Tom Rini | 2019-03-08 11:31:44 -0500 |
commit | d32aa3cae44e618048ff7f378577d44f9b6d6dcc (patch) | |
tree | fc4cfbe78b9629281ee4a8c1ccead9204afa9224 /tools/imagetool.h | |
parent | 280fafff165428bc69db221faaccaf4edfc32d9d (diff) |
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.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/imagetool.h b/tools/imagetool.h index 71471420f9c..2689a4004a7 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 |