summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-01-29 02:15:49 +0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-02-05 22:25:13 +0100
commit3bb035b095a0e4144adfa55fa45b2332e3a6c7d5 (patch)
tree6990649fbb3e3c95f11818206125a44cb1b30edc /util/cbfstool/cbfstool.c
parenteab2c81949c8859892443c1e71449f391bc52d97 (diff)
cbfstool: Use cbfs_image API for "print" command.
Process CBFS ROM image by new cbfs_image API. To verify, run "cbfstool coreboot.rom print -v" and compare with old cbfstool. Change-Id: I3a5a9ef176596d825e6cdba28a8ad732f69f5600 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2206 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 11f1914e2e..d70f757fc5 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -27,6 +27,7 @@
#include <getopt.h>
#include "common.h"
#include "cbfs.h"
+#include "cbfs_image.h"
struct command {
const char *name;
@@ -387,18 +388,14 @@ static int cbfs_locate(void)
static int cbfs_print(void)
{
- void *rom;
-
- rom = loadrom(param.cbfs_name);
- if (rom == NULL) {
+ struct cbfs_image image;
+ if (cbfs_image_from_file(&image, param.cbfs_name) != 0) {
ERROR("Could not load ROM image '%s'.\n",
param.cbfs_name);
return 1;
}
-
- print_cbfs_directory(param.cbfs_name);
-
- free(rom);
+ cbfs_print_directory(&image);
+ cbfs_image_delete(&image);
return 0;
}