Skip filling legacy_img_hdr structure for XIP images which do not use
legacy_img_hdr structure header. Adding unwanted header to other image
formats, like kwbimage cause generation of broken image.
Signed-off-by: Pali Rohár <pali@kernel.org>
exit (EXIT_FAILURE);
}
- if (params.xflag) {
+ if (params.xflag &&
+ (((params.type > IH_TYPE_INVALID) && (params.type < IH_TYPE_FLATDT)) ||
+ (params.type == IH_TYPE_KERNEL_NOLOAD) || (params.type == IH_TYPE_FIRMWARE_IVT))) {
unsigned char *p = NULL;
/*
* XIP: do not append the struct legacy_img_hdr at the