Wim Vervoorn has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38460 )
Change subject: util/ifdtool: Correct region resize handling ......................................................................
util/ifdtool: Correct region resize handling
When regions are resized they are always aligned to the top of the region. For this BIOS region this is correct. The other regions however should be aligned to the bottom of the region.
Updated the region handling to only align BIOS region to top of region.
BUG=N/A TEST=verified image resize
Change-Id: Ied0e763b5335f5f124fc00de38e5db1a4d0f6785 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com --- M util/ifdtool/ifdtool.c 1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/38460/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index a59f36b..0b6b210 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1358,11 +1358,12 @@ if (new->size > current->size) { /* copy from the end of the current region */ copy_size = current->size; - offset_new = new->size - current->size; + if (i == REGION_BIOS) + offset_new = new->size - current->size; }
- if (new->size < current->size) { - /* copy to the end of the new region */ + if ((i == REGION_BIOS) && (new->size < current->size)) { + /* copy BIOS region to the end of the new region */ offset_current = current->size - new->size; }
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38460 )
Change subject: util/ifdtool: Correct region resize handling ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG@10 PS2, Line 10: this the
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG@11 PS2, Line 11: should be aligned to the bottom of the region. Where is that documented?
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG@13 PS2, Line 13: Updated Update
Hello Frans Hendriks, Stefan Reinauer, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38460
to look at the new patch set (#3).
Change subject: util/ifdtool: Correct region resize handling ......................................................................
util/ifdtool: Correct region resize handling
When regions are resized they are always aligned to the top of the region. For the BIOS region this is correct. The other regions however should be aligned to the bottom of the region.
Update the region handling to only align BIOS region to top of region.
BUG=N/A TEST=verified image resize
Change-Id: Ied0e763b5335f5f124fc00de38e5db1a4d0f6785 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com --- M util/ifdtool/ifdtool.c 1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/38460/3
Wim Vervoorn has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38460 )
Change subject: util/ifdtool: Correct region resize handling ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG@10 PS2, Line 10: this
the
Done
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG@11 PS2, Line 11: should be aligned to the bottom of the region.
Where is that documented?
Done
https://review.coreboot.org/c/coreboot/+/38460/2//COMMIT_MSG@13 PS2, Line 13: Updated
Update
Done
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38460 )
Change subject: util/ifdtool: Correct region resize handling ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38460 )
Change subject: util/ifdtool: Correct region resize handling ......................................................................
util/ifdtool: Correct region resize handling
When regions are resized they are always aligned to the top of the region. For the BIOS region this is correct. The other regions however should be aligned to the bottom of the region.
Update the region handling to only align BIOS region to top of region.
BUG=N/A TEST=verified image resize
Change-Id: Ied0e763b5335f5f124fc00de38e5db1a4d0f6785 Signed-off-by: Wim Vervoorn wvervoorn@eltan.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/38460 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Frans Hendriks fhendriks@eltan.com --- M util/ifdtool/ifdtool.c 1 file changed, 4 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Frans Hendriks: Looks good to me, approved
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index a59f36b..0b6b210 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1358,11 +1358,12 @@ if (new->size > current->size) { /* copy from the end of the current region */ copy_size = current->size; - offset_new = new->size - current->size; + if (i == REGION_BIOS) + offset_new = new->size - current->size; }
- if (new->size < current->size) { - /* copy to the end of the new region */ + if ((i == REGION_BIOS) && (new->size < current->size)) { + /* copy BIOS region to the end of the new region */ offset_current = current->size - new->size; }