summaryrefslogtreecommitdiffstats
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-10-27 13:17:52 -0500
committerAaron Durbin <adurbin@chromium.org>2015-10-29 16:59:54 +0100
commit176250292920d119ca6d17181ef468714951b7e2 (patch)
tree54a2364a807bd5ffa757cd78c9de38d485259f30 /util/cbfstool/cbfstool.c
parent3fcb11478ff0a73b952069512ad0797749089e7d (diff)
downloadcoreboot-176250292920d119ca6d17181ef468714951b7e2.tar.gz
coreboot-176250292920d119ca6d17181ef468714951b7e2.tar.bz2
coreboot-176250292920d119ca6d17181ef468714951b7e2.zip
cbfstool: add optional -m ARCH to extract
In order to prepare allowing for one to extract a stage into an ELF file provide an optional -m ARCH option. This allows one to indicate to cbfstool what architecture type the ELF file should be in. Longer term each stage and payload will have an attribute associated with it which indicates the attributes of the executable. Change-Id: Id190c9719908afa85d5a3b2404ff818009eabb4c Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12217 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 58f801790ed5..08962fd55e6f 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -795,7 +795,8 @@ static int cbfs_extract(void)
param.headeroffset))
return 1;
- return cbfs_export_entry(&image, param.name, param.filename);
+ return cbfs_export_entry(&image, param.name, param.filename,
+ param.arch);
}
static int cbfs_write(void)
@@ -945,7 +946,7 @@ static const struct command commands[] = {
{"add-master-header", "H:r:vh?", cbfs_add_master_header, true, true},
{"copy", "H:D:s:h?", cbfs_copy, true, true},
{"create", "M:r:s:B:b:H:o:m:vh?", cbfs_create, true, true},
- {"extract", "H:r:n:f:vh?", cbfs_extract, true, false},
+ {"extract", "H:r:m:n:f:vh?", cbfs_extract, true, false},
{"layout", "wvh?", cbfs_layout, false, false},
{"print", "H:r:vh?", cbfs_print, true, false},
{"read", "r:f:vh?", cbfs_read, true, false},
@@ -1088,7 +1089,7 @@ static void usage(char *name)
"List mutable (or, with -w, readable) image regions\n"
" print [-r image,regions] "
"Show the contents of the ROM\n"
- " extract [-r image,regions] -n NAME -f FILE "
+ " extract [-r image,regions] [-m ARCH] -n NAME -f FILE "
"Extracts a raw payload from ROM\n"
" write -r image,regions -f file [-u | -d] "
"Write file into same-size [or larger] raw region\n"