summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2011-10-14 12:44:14 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-10-17 17:50:22 +0200
commitfbadc499a6268f5d69d4aa1844153d6ae1e82cf0 (patch)
tree0fcfdf756eb4b604cfff46633eb05abd4f1bdc92 /util/cbfstool/cbfstool.c
parenta9a8b801911ec7ebd1163c757bcec2635af5a641 (diff)
downloadcoreboot-fbadc499a6268f5d69d4aa1844153d6ae1e82cf0.tar.xz
cbfstool: improve error messages
If a file can't be added by cbfstool, print the type and name of the file in the error message. Change-Id: I369d6f5be09ec53ee5beea2cfea65a80407f0ba3 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/271 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 4c28c29844..f017b2e2e0 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -81,8 +81,10 @@ static int cbfs_add(int argc, char **argv)
base = strtoul(argv[6], NULL, 0);
}
cbfsfile = create_cbfs_file(cbfsname, filedata, &filesize, type, &base);
- if (add_file_to_cbfs(cbfsfile, filesize, base))
+ if (add_file_to_cbfs(cbfsfile, filesize, base)) {
+ printf("Adding file '%s' failed.\n", filename);
return 1;
+ }
if (writerom(romname, rom, romsize))
return 1;
return 0;
@@ -130,8 +132,10 @@ static int cbfs_add_payload(int argc, char **argv)
cbfsfile =
create_cbfs_file(cbfsname, payload, &filesize,
CBFS_COMPONENT_PAYLOAD, &base);
- if (add_file_to_cbfs(cbfsfile, filesize, base))
+ if (add_file_to_cbfs(cbfsfile, filesize, base)) {
+ printf("Adding payload '%s' failed.\n", filename);
return 1;
+ }
if (writerom(romname, rom, romsize))
return 1;
return 0;
@@ -180,8 +184,10 @@ static int cbfs_add_stage(int argc, char **argv)
create_cbfs_file(cbfsname, stage, &filesize,
CBFS_COMPONENT_STAGE, &base);
- if (add_file_to_cbfs(cbfsfile, filesize, base))
+ if (add_file_to_cbfs(cbfsfile, filesize, base)) {
+ printf("Adding stage '%s' failed.\n", filename);
return 1;
+ }
if (writerom(romname, rom, romsize))
return 1;
return 0;