diff options
author | Nico Huber <nico.h@gmx.de> | 2018-12-22 00:53:14 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2019-01-04 23:53:01 +0000 |
commit | 69f96f60295d82ac9525fbd20aa94a3d86c2904c (patch) | |
tree | 753846b317d5313b2374394e293c68393b8adae8 /layout.c | |
parent | ec8b8a7feb626eb415ffa260fb09149a84dc7ead (diff) | |
download | flashrom-54d2ed222d45516b6e6922cab609d6de5b83ae96.tar.gz flashrom-54d2ed222d45516b6e6922cab609d6de5b83ae96.tar.bz2 flashrom-54d2ed222d45516b6e6922cab609d6de5b83ae96.zip |
Fix verification with sparse layoutsv1.0.1-rc1
The full verification step was not accounting for sparse layouts.
Instead of the old contents, combine_image_by_layout() implicitly
assumed the new contents for unspecified regions.
Change-Id: I44e0cea621f2a3d4dc70fa7e93c52ed95e54014a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/30372
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'layout.c')
-rw-r--r-- | layout.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -225,3 +225,21 @@ int normalize_romentries(const struct flashctx *flash) return ret; } + +const struct romentry *layout_next_included_region( + const struct flashrom_layout *const l, const chipoff_t where) +{ + unsigned int i; + const struct romentry *lowest = NULL; + + for (i = 0; i < l->num_entries; ++i) { + if (!l->entries[i].included) + continue; + if (l->entries[i].end < where) + continue; + if (!lowest || lowest->start > l->entries[i].start) + lowest = &l->entries[i]; + } + + return lowest; +} |