]> git.sur5r.net Git - u-boot/commitdiff
mkimage: Add a quiet mode
authorSimon Glass <sjg@chromium.org>
Sun, 1 May 2016 19:55:38 +0000 (13:55 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 23 May 2016 15:50:19 +0000 (11:50 -0400)
Some build systems want to be quiet unless there is a problem. At present
mkimage displays quite a bit of information when generating a FIT file. Add
a '-q' flag to silence this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
tools/imagetool.c
tools/imagetool.h
tools/mkimage.c

index 916ab964d553e2d214be17a58f1f8f86b7a36ffe..08d191d9f894a6b86afd867de33ec4026c2286f2 100644 (file)
@@ -51,7 +51,8 @@ int imagetool_verify_print_header(
                                 * successful
                                 */
                                if ((*curr)->print_header) {
-                                       (*curr)->print_header(ptr);
+                                       if (!params->quiet)
+                                               (*curr)->print_header(ptr);
                                } else {
                                        fprintf(stderr,
                                                "%s: print_header undefined for %s\n",
index 24f8f4b2f6352fbfb6e86388236be1fb0f501e3c..a3ed0f43d6afa21caa6d8755536b17d8a3f27ba2 100644 (file)
@@ -73,6 +73,7 @@ struct image_tool_params {
        struct content_info *content_head;      /* List of files to include */
        struct content_info *content_tail;
        bool external_data;     /* Store data outside the FIT */
+       bool quiet;             /* Don't output text in normal operation */
 };
 
 /*
index 93d1c16c7ce0e8afa580ccfb84bc8e454b163f54..aefe22f19b219a7d339dbfdc6f92ca1afe8b1831 100644 (file)
@@ -136,7 +136,7 @@ static void process_args(int argc, char **argv)
        int opt;
 
        while ((opt = getopt(argc, argv,
-                            "a:A:b:cC:d:D:e:Ef:Fk:K:ln:O:rR:sT:vVx")) != -1) {
+                            "a:A:b:cC:d:D:e:Ef:Fk:K:ln:O:rR:qsT:vVx")) != -1) {
                switch (opt) {
                case 'a':
                        params.addr = strtoull(optarg, &ptr, 16);
@@ -216,6 +216,9 @@ static void process_args(int argc, char **argv)
                        if (params.os < 0)
                                usage("Invalid operating system");
                        break;
+               case 'q':
+                       params.quiet = 1;
+                       break;
                case 'r':
                        params.require_keys = 1;
                        break;