diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2016-12-12 18:38:01 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2016-12-13 19:10:46 +0100 |
commit | 16b3e4bd2c2dbc14c42be85cca60ea647e60bd99 (patch) | |
tree | 2fd361be3769ff0e8243cd154c85064611cd5777 | |
parent | ffc934d9440b5a8dabcedb4da0fa88d9a1e65e18 (diff) |
util/cbfstool: require -i argument for cbfstool add-int
We never specified what value add-int should write by default.
Change-Id: I240be4842fc374690c4a718fc4d8f0a03d63003c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17796
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
-rw-r--r-- | util/cbfstool/cbfstool.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index c823dc8209..2d8483ba0b 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -70,6 +70,7 @@ static struct param { uint32_t cbfsoffset; uint32_t cbfsoffset_assigned; uint32_t arch; + bool u64val_assigned; bool fill_partial_upward; bool fill_partial_downward; bool show_immutable; @@ -716,6 +717,10 @@ static int cbfs_add_flat_binary(void) static int cbfs_add_integer(void) { + if (!param.u64val_assigned) { + ERROR("You need to specify a value to write.\n"); + return 1; + } return cbfs_add_integer_component(param.name, param.u64val, param.baseaddress, @@ -1452,6 +1457,7 @@ int main(int argc, char **argv) break; case 'i': param.u64val = strtoull(optarg, &suffix, 0); + param.u64val_assigned = 1; if (!*optarg || (suffix && *suffix)) { ERROR("Invalid int parameter '%s'.\n", optarg); |