Nicholas Chin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86009?usp=email )
Change subject: util/cbfstool: Remove existing file for add-int command ......................................................................
util/cbfstool: Remove existing file for add-int command
Since add-int is intended for manipulating options stored as integers in CBFS (such as SeaBIOS runtime config options), removing the file so that it can be re-added with a new value is a common action. Attempt to remove the existing integer automatically if it already exists to remove the need for the extra step.
Change-Id: I5a0ac409fc9b91a4f7c0c35650875d6211ac2b25 Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M util/cbfstool/cbfstool.c 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/86009/1
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 3ba6bcd..783c7d9 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -653,8 +653,10 @@ }
if (cbfs_get_entry(&image, name)) { - ERROR("'%s' already in ROM image.\n", name); - goto done; + if (cbfs_remove_entry(&image, name) != 0) { + ERROR("Removing file '%s' failed.\n", name); + goto done; + } }
header = cbfs_create_file_header(CBFS_TYPE_RAW,