Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43402 )
Change subject: util/cbfstool/ifittool.c: Handle CBFS stages when added as FIT IBB entry ......................................................................
util/cbfstool/ifittool.c: Handle CBFS stages when added as FIT IBB entry
CBFS stages have an additional header preceding the program file. This header is added to each stage and breaks the 64 byte granularity required for IBB segments. When adding stages as FIT entries omit the header to maintain the 64 byte granularity.
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: Id6a6c52c15895842ced6ac3ff89487e874b772ff --- M util/cbfstool/ifittool.c 1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/43402/1
diff --git a/util/cbfstool/ifittool.c b/util/cbfstool/ifittool.c index 7e99d4f..4d85229 100644 --- a/util/cbfstool/ifittool.c +++ b/util/cbfstool/ifittool.c @@ -349,6 +349,7 @@ } else { uint32_t offset, len; struct cbfs_file *cbfs_file; + struct cbfs_stage *cbfs_stage;
cbfs_file = cbfs_get_entry(&image, name); if (!cbfs_file) { @@ -363,6 +364,15 @@ cbfs_get_entry_addr(&image, cbfs_file) + ntohl(cbfs_file->offset));
+ /* + * For Boot Guard FIT IBB entries omit the stage header, + * otherwise we cannot achieve 64 byte granularity. + */ + if(ntohl(cbfs_file->type) == CBFS_COMPONENT_STAGE) { + cbfs_stage = (struct cbfs_stage *)((uint8_t *)cbfs_file + ntohl(cbfs_file->offset)); + len = cbfs_stage->len; + offset += sizeof(struct cbfs_stage); + }
if (fit_add_entry(fit, offset, len, fit_type, max_table_size)) {
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43402 )
Change subject: util/cbfstool/ifittool.c: Handle CBFS stages when added as FIT IBB entry ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/43402/1/util/cbfstool/ifittool.c File util/cbfstool/ifittool.c:
https://review.coreboot.org/c/coreboot/+/43402/1/util/cbfstool/ifittool.c@37... PS1, Line 371: if(ntohl(cbfs_file->type) == CBFS_COMPONENT_STAGE) { space required before the open parenthesis '('
https://review.coreboot.org/c/coreboot/+/43402/1/util/cbfstool/ifittool.c@37... PS1, Line 372: cbfs_stage = (struct cbfs_stage *)((uint8_t *)cbfs_file + ntohl(cbfs_file->offset)); line over 96 characters
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/43402?usp=email )
Change subject: util/cbfstool/ifittool.c: Handle CBFS stages when added as FIT IBB entry ......................................................................
Abandoned