aboutsummaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorJianhui Zhao <zhaojh329@gmail.com>2023-10-20 11:59:34 +0800
committerDaniel Golle <daniel@makrotopia.org>2023-10-31 22:12:30 +0000
commit3bbc1d5fba1d700917138334a48c16bafdf48de9 (patch)
treeb0ec6e4c8b2ca9d4a76372b5170f3121d280a289 /package
parent9a47688eeeefe54097e0e9231e3a6e3300eb0189 (diff)
uboot-mediatek: fix determine the size of an uImage.FIT using 'imsz' or 'imszb'.
It must read the entire image for previous code of 'imsz' or 'imszb'. Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com> Suggested-by: Chuanhong Guo <gch981213@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch12
1 files changed, 5 insertions, 7 deletions
diff --git a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
index 574259fb39..ae7623086e 100644
--- a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
+++ b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
@@ -70,7 +70,7 @@
{
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
-@@ -2051,6 +2051,49 @@ static const char *fit_get_image_type_pr
+@@ -2051,6 +2051,47 @@ static const char *fit_get_image_type_pr
return "unknown";
}
@@ -93,11 +93,8 @@
+ max_size = hdrsize;
+
+ images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
-+ if (images_noffset < 0) {
-+ printf("Can't find images parent node '%s' (%s)\n",
-+ FIT_IMAGES_PATH, fdt_strerror(images_noffset));
-+ return 0;
-+ }
++ if (images_noffset < 0)
++ goto out;
+
+ for (ndepth = 0,
+ noffset = fdt_next_node(fit, images_noffset, &ndepth);
@@ -106,7 +103,7 @@
+ if (ndepth == 1) {
+ ret = fit_image_get_data_and_size(fit, noffset, &data, &data_size);
+ if (ret)
-+ return 0;
++ goto out;
+
+ img_total = data_size + (data - fit);
+
@@ -114,6 +111,7 @@
+ }
+ }
+
++out:
+ return max_size;
+}
+