[PATCH] socfpga_mkimage: Fix/clarify error message

Sascha Hauer s.hauer at pengutronix.de
Tue Jul 7 23:20:54 PDT 2015


The actual max_image_size may be smaller than the define MAX_IMAGE_SIZE
due to the additional header needed, so print max_image_size in the
error message. Also, when complaining about a too big image say how big
the image actually is.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 scripts/socfpga_mkimage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/socfpga_mkimage.c b/scripts/socfpga_mkimage.c
index bab1b1a..1a7a66d 100644
--- a/scripts/socfpga_mkimage.c
+++ b/scripts/socfpga_mkimage.c
@@ -234,8 +234,8 @@ int main(int argc, char *argv[])
 	}
 
 	if (s.st_size > max_image_size) {
-		fprintf(stderr, "input image too big. Maximum is %d bytes\n",
-				MAX_IMAGE_SIZE);
+		fprintf(stderr, "input image too big. Maximum is %d bytes, got %ld bytes\n",
+				max_image_size, s.st_size);
 		exit(1);
 	}
 
-- 
2.1.4




More information about the barebox mailing list