Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11217
-gerrit
commit 132bf9a9a3913272d75f27a8cd929bc587af5b3f Author: Patrick Georgi pgeorgi@google.com Date: Tue Aug 11 15:55:16 2015 +0200
cbfstool: honor larger-than-usual header sizes in cbfs_add_entry_at()
If an earlier stage built a larger header, cbfs_add_entry_at() shouldn't decide to go with the most boring, least featureful header type (and its size) instead.
Change-Id: Icc5dcd9a797a0f3c42f91cddd21b3b3916095b63 Signed-off-by: Patrick Georgi pgeorgi@google.com --- util/cbfstool/cbfs_image.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index ed065b0..b45969c 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -457,13 +457,13 @@ static int cbfs_add_entry_at(struct cbfs_image *image, const char *name, uint32_t type, const void *data, - uint32_t content_offset) + uint32_t content_offset, + uint32_t header_size) { struct cbfs_file *next = cbfs_find_next_entry(image, entry); uint32_t addr = cbfs_get_entry_addr(image, entry), addr_next = cbfs_get_entry_addr(image, next); - uint32_t header_size = cbfs_calculate_file_header_size(name), - min_entry_size = cbfs_calculate_file_header_size(""); + uint32_t min_entry_size = cbfs_calculate_file_header_size(""); uint32_t len, target; uint32_t align = image->has_header ? image->header.align : CBFS_ENTRY_ALIGNMENT; @@ -635,7 +635,8 @@ int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer, addr, addr_next - addr, content_offset);
if (cbfs_add_entry_at(image, entry, buffer->size, name, type, - buffer->data, content_offset) == 0) { + buffer->data, content_offset, + header_size) == 0) { return 0; } break;