diff options
author | Wim Vervoorn <wvervoorn@eltan.com> | 2020-01-17 13:48:00 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-01-20 10:49:12 +0000 |
commit | 05bc9b38a31bc6f3836a32a6ea9880f6a570f0f6 (patch) | |
tree | 9c10576106199c4523dbf70a9f1e2e9d524c11b4 /util | |
parent | 42d300533e6388d0c31d700ec5ea29d21e0216cd (diff) |
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>
Diffstat (limited to 'util')
-rw-r--r-- | util/ifdtool/ifdtool.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index a59f36b886..0b6b210647 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1358,11 +1358,12 @@ static void new_layout(const char *filename, char *image, int size, 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; } |