tools/mkimage: update to 2023.01
[openwrt/openwrt.git] / tools / mkimage / patches / 030-allow-to-use-different-magic.patch
index 591edf24eaf82861b4432ed53a7f1123b2399c56..d88f1cf9496ed2bf00ca18b7af208d9c933455eb 100644 (file)
@@ -52,14 +52,14 @@ This patch makes it possible to set a custom image magic.
 +++ b/tools/default_image.c
 @@ -56,7 +56,7 @@ static int image_verify_header(unsigned
         */
-       memcpy(hdr, ptr, sizeof(image_header_t));
+       memcpy(hdr, ptr, sizeof(struct legacy_img_hdr));
  
 -      if (be32_to_cpu(hdr->ih_magic) != IH_MAGIC) {
 +      if (be32_to_cpu(hdr->ih_magic) != params->magic) {
                debug("%s: Bad Magic Number: \"%s\" is no valid image\n",
                      params->cmdname, params->imagefile);
                return -FDT_ERR_BADMAGIC;
-@@ -120,7 +120,7 @@ static void image_set_header(void *ptr,
+@@ -119,7 +119,7 @@ static void image_set_header(void *ptr,
        }
  
        /* Build new header */