ifdtool: don't write unused regions into a layout file

flashrom treats them as invalid because start > end.

Change-Id: I1c8b4563094823ebd9b1193b91e7b4a748955228
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16936
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Alexander Couzens 2016-10-08 00:53:09 +02:00 committed by Martin Roth
parent 6ed319a796
commit eff596b51a
1 changed files with 5 additions and 0 deletions

View File

@ -296,6 +296,11 @@ static void dump_frba_layout(frba_t * frba, char *layout_fname)
}
for (i = 0; i < max_regions; i++) {
region_t region = get_region(frba, i);
/* is region invalid? */
if (region.size < 1)
continue;
dump_region_layout(buf, bufsize, i, frba);
if (write(layout_fd, buf, strlen(buf)) < 0) {
perror("Could not write to file");