Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11215
-gerrit
commit 034691130db1e4d89d8f50b3992cd37689bb7769 Author: Patrick Georgi pgeorgi@google.com Date: Tue Aug 11 15:10:33 2015 +0200
cbfstool: calculate header size in cbfs_add_component()
It will at some point create the header, and pass it with its size. We can start with the size already.
Change-Id: I8f26b2335ffab99a664d1ff7bc88e33ed62cf9ca Signed-off-by: Patrick Georgi pgeorgi@google.com --- util/cbfstool/cbfstool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 80e3895..57db97c 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -201,6 +201,8 @@ static int cbfs_add_component(const char *filename, return 1; }
+ uint32_t header_size = cbfs_calculate_file_header_size(name); + if (convert && convert(&buffer, &offset) != 0) { ERROR("Failed to parse file '%s'.\n", filename); buffer_delete(&buffer); @@ -211,7 +213,8 @@ static int cbfs_add_component(const char *filename, offset = convert_to_from_top_aligned(param.image_region, -offset);
- if (cbfs_add_entry(&image, &buffer, name, type, offset, 0) != 0) { + if (cbfs_add_entry(&image, &buffer, name, type, offset, header_size) + != 0) { ERROR("Failed to add '%s' into ROM image.\n", filename); buffer_delete(&buffer); return 1;