[coreboot-gerrit] New patch to review for coreboot: util/cbfstool: require -i argument for cbfstool add-int

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Mon Dec 12 18:38:58 CET 2016


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17796

-gerrit

commit 35793c27ff8ebc0b0cc25440fb3676efc5852a7e
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Mon Dec 12 18:38:01 2016 +0100

    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 at chromium.org>
---
 util/cbfstool/cbfstool.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index c823dc8..2d8483b 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);



More information about the coreboot-gerrit mailing list