summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 23787d89f4..13a9956045 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -75,6 +75,7 @@ static struct param {
bool show_immutable;
bool stage_xip;
bool autogen_attr;
+ bool machine_parseable;
int fit_empty_entries;
enum comp_algo compression;
enum vb2_hash_algorithm hash;
@@ -838,8 +839,10 @@ static int cbfs_print(void)
if (cbfs_image_from_buffer(&image, param.image_region,
param.headeroffset))
return 1;
- cbfs_print_directory(&image);
- return 0;
+ if (param.machine_parseable)
+ return cbfs_print_parseable_directory(&image);
+ else
+ return cbfs_print_directory(&image);
}
/* Forward declared so there aren't type collisions with cbfstool proper
@@ -1066,7 +1069,7 @@ static const struct command commands[] = {
{"hashcbfs", "r:R:A:vh?", cbfs_hash, true, true},
{"extract", "H:r:m:n:f:vh?", cbfs_extract, true, false},
{"layout", "wvh?", cbfs_layout, false, false},
- {"print", "H:r:vh?", cbfs_print, true, false},
+ {"print", "H:r:vkh?", cbfs_print, true, false},
{"read", "r:f:vh?", cbfs_read, true, false},
{"remove", "H:r:n:vh?", cbfs_remove, true, true},
{"update-fit", "H:r:n:x:vh?", cbfs_update_fit, true, true},
@@ -1105,6 +1108,7 @@ static struct option long_options[] = {
{"with-readonly", no_argument, 0, 'w' },
{"xip", no_argument, 0, 'y' },
{"gen-attribute", no_argument, 0, 'g' },
+ {"mach-parseable",no_argument, 0, 'k' },
{NULL, 0, 0, 0 }
};
@@ -1407,6 +1411,9 @@ int main(int argc, char **argv)
case 'g':
param.autogen_attr = true;
break;
+ case 'k':
+ param.machine_parseable = true;
+ break;
case 'h':
case '?':
usage(argv[0]);