[U-Boot] [PATCH v2] mkimage: add "-V" option to print version information

Wolfgang Denk wd at denx.de
Fri Feb 11 13:22:29 CET 2011


Signed-off-by: Wolfgang Denk <wd at denx.de>
---
v2: fix missing argument to printf() call.

 tools/mkimage.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/mkimage.c b/tools/mkimage.c
index f5859d7..127be57 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -23,6 +23,7 @@
 
 #include "mkimage.h"
 #include <image.h>
+#include <version.h>
 
 static void copy_file(int, const char *, int);
 static void usage(void);
@@ -246,6 +247,10 @@ main (int argc, char **argv)
 			case 'v':
 				params.vflag++;
 				break;
+			case 'V':
+				printf("mkimage version %s\n",
+					U_BOOT_VERSION + 7);
+				exit(EXIT_SUCCESS);
 			case 'x':
 				params.xflag++;
 				break;
@@ -590,6 +595,8 @@ usage ()
 		params.cmdname);
 	fprintf (stderr, "       %s [-D dtc_options] -f fit-image.its fit-image\n",
 		params.cmdname);
+	fprintf (stderr, "       %s -V ==> print version information and exit\n",
+		params.cmdname);
 
 	exit (EXIT_FAILURE);
 }
-- 
1.7.4



More information about the U-Boot mailing list