summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/cbfs_image.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-04-27 19:31:03 -0700
committerJulius Werner <jwerner@chromium.org>2020-12-03 00:08:03 +0000
commitc4ee28c61d955f598f475ed70951a83ab55d7e45 (patch)
treece1c4517df8fae76ac435feb22756eb63572d19d /util/cbfstool/cbfs_image.h
parent7066a1e7b3f588c8c4ac0394c8c1f35e227dd552 (diff)
downloadcoreboot-c4ee28c61d955f598f475ed70951a83ab55d7e45.tar.gz
coreboot-c4ee28c61d955f598f475ed70951a83ab55d7e45.tar.bz2
coreboot-c4ee28c61d955f598f475ed70951a83ab55d7e45.zip
cbfstool: Hide hash printing behind -v and add to parseable output
With the upcoming introduction of CBFS verification, a lot more CBFS files will have hashes. The current cbfstool default of always printing hash attributes when they exist will make cbfstool print very messy. Therefore, hide hash attribute output unless the user passed -v. It would also be useful to be able to get file attributes like hashes in machine parseable output. Unfortunately, our machine parseable format (-k) doesn't really seem designed to be extensible. To avoid breaking older parsers, this patch adds new attribute output behind -v (which hopefully no current users pass since it doesn't change anything for -k at the moment). With this patch cbfstool print -k -v may print an arbitrary amount of extra tokens behind the predefined ones on a file line. Tokens always begin with an identifying string (e.g. 'hash'), followed by extra fields that should be separated by colons. Multiple tokens are separated by the normal separator character (tab). cbfstool print -k -v may also print additional information that applies to the whole CBFS on separate lines. These lines will always begin with a '[' (which hopefully nobody would use as a CBFS filename character although we technically have no restrictions at the moment). Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I9e16cda393fa0bc1d8734d4b699e30e2ae99a36d Reviewed-on: https://review.coreboot.org/c/coreboot/+/41119 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r--util/cbfstool/cbfs_image.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index 74c35c94438a..664d1461d7d8 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -162,8 +162,8 @@ int cbfs_is_legacy_cbfs(struct cbfs_image *image);
int cbfs_is_valid_entry(struct cbfs_image *image, struct cbfs_file *entry);
/* Print CBFS component information. */
-int cbfs_print_directory(struct cbfs_image *image);
-int cbfs_print_parseable_directory(struct cbfs_image *image);
+void cbfs_print_directory(struct cbfs_image *image);
+void cbfs_print_parseable_directory(struct cbfs_image *image);
int cbfs_print_header_info(struct cbfs_image *image);
int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry,
void *arg);