summaryrefslogtreecommitdiff
path: root/verity
diff options
context:
space:
mode:
authorMohamad Ayyash <mkayyash@google.com>2015-03-31 12:27:29 -0700
committerMohamad Ayyash <mkayyash@google.com>2015-03-31 12:29:05 -0700
commit70f72fb1035e753f5cef176339618723fba943e2 (patch)
treedf7f7d27e55f962079f2274b0e85da4a57a9a864 /verity
parentb7f56ac0176ae78e083bc8f95081b0befe2b17a2 (diff)
downloadextras-70f72fb1035e753f5cef176339618723fba943e2.tar.gz
build_verity_tree: Add verbose flag
Change-Id: I0c5607f7aa5e964abc2031bbe71ff5c6e6ef56cc Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
Diffstat (limited to 'verity')
-rw-r--r--verity/build_verity_tree.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/verity/build_verity_tree.cpp b/verity/build_verity_tree.cpp
index 5e04ce50..e7bfa405 100644
--- a/verity/build_verity_tree.cpp
+++ b/verity/build_verity_tree.cpp
@@ -115,6 +115,7 @@ void usage(void)
" -A,--salt-hex=<hex digits> set salt to <hex digits>\n"
" -h show this help\n"
" -s,--verity-size=<data size> print the size of the verity tree\n"
+ " -v, enable verbose logging\n"
" -S treat <data image> as a sparse file\n"
);
}
@@ -128,6 +129,7 @@ int main(int argc, char **argv)
bool sparse = false;
size_t block_size = 4096;
uint64_t calculate_size = 0;
+ bool verbose = false;
while (1) {
const static struct option long_options[] = {
@@ -136,9 +138,10 @@ int main(int argc, char **argv)
{"help", no_argument, 0, 'h'},
{"sparse", no_argument, 0, 'S'},
{"verity-size", required_argument, 0, 's'},
+ {"verbose", no_argument, 0, 'v'},
{NULL, 0, 0, 0}
};
- int c = getopt_long(argc, argv, "a:A:hSs:", long_options, NULL);
+ int c = getopt_long(argc, argv, "a:A:hSs:v", long_options, NULL);
if (c < 0) {
break;
}
@@ -187,6 +190,9 @@ int main(int argc, char **argv)
calculate_size = (uint64_t)inSize;
}
break;
+ case 'v':
+ verbose = true;
+ break;
case '?':
usage();
return 1;
@@ -260,7 +266,7 @@ int main(int argc, char **argv)
if (sparse) {
file = sparse_file_import(fd, false, false);
} else {
- file = sparse_file_import_auto(fd, false);
+ file = sparse_file_import_auto(fd, false, verbose);
}
if (!file) {