aboutsummaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/cbfs_image.c')
-rw-r--r--util/cbfstool/cbfs_image.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index e095187979..e78ee40d74 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -533,7 +533,8 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
}
int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer,
- const char *name, uint32_t type, uint32_t content_offset)
+ const char *name, uint32_t type, uint32_t content_offset,
+ uint32_t header_size)
{
assert(image);
assert(buffer);
@@ -544,9 +545,10 @@ int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer,
uint32_t entry_type;
uint32_t addr, addr_next;
struct cbfs_file *entry, *next;
- uint32_t header_size, need_size, new_size;
+ uint32_t need_size, new_size;
- header_size = cbfs_calculate_file_header_size(name);
+ if (header_size == 0)
+ header_size = cbfs_calculate_file_header_size(name);
need_size = header_size + buffer->size;
DEBUG("cbfs_add_entry('%s'@0x%x) => need_size = %u+%zu=%u\n",