Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11216
-gerrit
commit 88632d7aa7d5c62a2cf7a7cfa531cfef0349a43d Author: Patrick Georgi pgeorgi@google.com Date: Tue Aug 11 15:16:24 2015 +0200
cbfstool: allow file data converters to modify the header size
The idea is that they can at some point add extended attributes to the header. That also needs to be passed, but let's start simple.
Change-Id: I80359843078b149ac433ee3d739ea192592e16e7 Signed-off-by: Patrick Georgi pgeorgi@google.com --- util/cbfstool/cbfstool.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 57db97c..bf51956 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -115,7 +115,8 @@ static unsigned convert_to_from_top_aligned(const struct buffer *region, return image_size - region->offset - offset; }
-typedef int (*convert_buffer_t)(struct buffer *buffer, uint32_t *offset); +typedef int (*convert_buffer_t)(struct buffer *buffer, uint32_t *offset, + uint32_t *header_size);
static int cbfs_add_integer_component(const char *name, uint64_t u64val, @@ -203,7 +204,7 @@ static int cbfs_add_component(const char *filename,
uint32_t header_size = cbfs_calculate_file_header_size(name);
- if (convert && convert(&buffer, &offset) != 0) { + if (convert && convert(&buffer, &offset, &header_size) != 0) { ERROR("Failed to parse file '%s'.\n", filename); buffer_delete(&buffer); return 1; @@ -224,7 +225,8 @@ static int cbfs_add_component(const char *filename, return 0; }
-static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset) +static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset, + unused uint32_t *header_size) { struct buffer output; int ret; @@ -239,7 +241,7 @@ static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset) }
static int cbfstool_convert_mkpayload(struct buffer *buffer, - unused uint32_t *offset) + unused uint32_t *offset, unused uint32_t *header_size) { struct buffer output; int ret; @@ -269,7 +271,7 @@ static int cbfstool_convert_mkpayload(struct buffer *buffer, }
static int cbfstool_convert_mkflatpayload(struct buffer *buffer, - unused uint32_t *offset) + unused uint32_t *offset, unused uint32_t *header_size) { struct buffer output; if (parse_flat_binary_to_payload(buffer, &output,