Commit 976b38c0742dc1db13af03cae9ded4392e47182d
1 parent
04c2dd827b
Exists in
master
and in
54 other branches
mkimage: add "-V" option to print version information
Signed-off-by: Wolfgang Denk <wd@denx.de>
Showing 2 changed files with 12 additions and 2 deletions Side-by-side Diff
Makefile
... | ... | @@ -413,8 +413,12 @@ |
413 | 413 | cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin |
414 | 414 | |
415 | 415 | $(VERSION_FILE): |
416 | - @( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \ | |
417 | - '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp | |
416 | + @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ | |
417 | + printf '#define PLAIN_VERSION "%s%s"\n' \ | |
418 | + "$(U_BOOT_VERSION)" "$${localvers}" ; \ | |
419 | + printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ | |
420 | + "$(U_BOOT_VERSION)" "$${localvers}" ; \ | |
421 | + ) > $@.tmp | |
418 | 422 | @( printf '#define CC_VERSION_STRING "%s"\n' \ |
419 | 423 | '$(shell $(CC) --version | head -n 1)' )>> $@.tmp |
420 | 424 | @( printf '#define LD_VERSION_STRING "%s"\n' \ |
tools/mkimage.c
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | |
24 | 24 | #include "mkimage.h" |
25 | 25 | #include <image.h> |
26 | +#include <version.h> | |
26 | 27 | |
27 | 28 | static void copy_file(int, const char *, int); |
28 | 29 | static void usage(void); |
... | ... | @@ -246,6 +247,9 @@ |
246 | 247 | case 'v': |
247 | 248 | params.vflag++; |
248 | 249 | break; |
250 | + case 'V': | |
251 | + printf("mkimage version %s\n", PLAIN_VERSION); | |
252 | + exit(EXIT_SUCCESS); | |
249 | 253 | case 'x': |
250 | 254 | params.xflag++; |
251 | 255 | break; |
... | ... | @@ -589,6 +593,8 @@ |
589 | 593 | " -x ==> set XIP (execute in place)\n", |
590 | 594 | params.cmdname); |
591 | 595 | fprintf (stderr, " %s [-D dtc_options] -f fit-image.its fit-image\n", |
596 | + params.cmdname); | |
597 | + fprintf (stderr, " %s -V ==> print version information and exit\n", | |
592 | 598 | params.cmdname); |
593 | 599 | |
594 | 600 | exit (EXIT_FAILURE); |