aboutsummaryrefslogtreecommitdiff
path: root/tools/imagetool.h
diff options
context:
space:
mode:
authorPali Rohár2022-02-13 01:09:46 +0100
committerTom Rini2022-02-28 10:33:11 -0500
commit11f29d443622070c9423ed5fda74b9564570aac7 (patch)
tree3f69b209af8f00ed44ee648aeeebe3d8114f221e /tools/imagetool.h
parenta900c7f8161b74fc66ec715e68e7244b53f04298 (diff)
tools: mkimage/dumpimage: Allow to use -l with -T
Currently -l option for mkimage and dumpimage ignores option -T and always tries to autodetect image type. With this change it is possible to tell mkimage and dumpimage to parse image file as specific type (and not random autodetected type). This allows to use mkimage -l or dumpimage -l as tool for validating image. params.type for -l option is now by default initialized to zero (IH_TYPE_INVALID) instead of IH_TYPE_KERNEL. imagetool_get_type() for IH_TYPE_INVALID returns NULL, which is assigned to tparams. mkimage and dumpimage code is extended to handle tparams with NULL for -l option. And imagetool_verify_print_header() is extended to do validation via tparams if is not NULL. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/imagetool.h')
-rw-r--r--tools/imagetool.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/tools/imagetool.h b/tools/imagetool.h
index c3f80fc64e8..5169b0245da 100644
--- a/tools/imagetool.h
+++ b/tools/imagetool.h
@@ -178,33 +178,19 @@ struct image_type_params *imagetool_get_type(int type);
/*
* imagetool_verify_print_header() - verifies the image header
*
- * Scan registered image types and verify the image_header for each
- * supported image type. If verification is successful, this prints
- * the respective header.
- *
- * Return: 0 on success, negative if input image format does not match with
- * any of supported image types
- */
-int imagetool_verify_print_header(
- void *ptr,
- struct stat *sbuf,
- 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 tparams is NULL then scan registered image types and verify the
+ * image_header for each supported image type.
* 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
+ * @tparams: image type parameters or NULL
* @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(
+int imagetool_verify_print_header(
void *ptr,
struct stat *sbuf,
struct image_type_params *tparams,