[coreboot-gerrit] New patch to review for coreboot: cbfstool: add optional -m ARCH to extract

Aaron Durbin (adurbin@chromium.org) gerrit at coreboot.org
Wed Oct 28 17:44:41 CET 2015


Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12217

-gerrit

commit 325dcc6c7b567dce38203b7e259c2293c1dac148
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue Oct 27 13:17:52 2015 -0500

    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 at chromium.org>
---
 util/cbfstool/cbfs_image.c | 2 +-
 util/cbfstool/cbfs_image.h | 2 +-
 util/cbfstool/cbfstool.c   | 7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 63151c9..245230a 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -725,7 +725,7 @@ static int cbfs_stage_decompress(struct buffer *buff)
 }
 
 int cbfs_export_entry(struct cbfs_image *image, const char *entry_name,
-		      const char *filename)
+		      const char *filename, unused uint32_t arch)
 {
 	struct cbfs_file *entry = cbfs_get_entry(image, entry_name);
 	struct buffer buffer;
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index f602976..9284754 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -90,7 +90,7 @@ struct cbfs_file *cbfs_get_entry(struct cbfs_image *image, const char *name);
 /* Exports an entry to external file.
  * Returns 0 on success, otherwise (ex, not found) non-zero. */
 int cbfs_export_entry(struct cbfs_image *image, const char *entry_name,
-		      const char *filename);
+		      const char *filename, uint32_t arch);
 
 /* Adds an entry to CBFS image by given name and type. If content_offset is
  * non-zero, try to align "content" (CBFS_SUBHEADER(p)) at content_offset.
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 58f8017..08962fd 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"



More information about the coreboot-gerrit mailing list