diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2016-10-08 00:53:09 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-10-10 18:01:00 +0200 |
commit | eff596b51ad6691365d9e871772d72ff72614270 (patch) | |
tree | 5e8cbb1e45270073654056e4ba67330ce049602a /util/ifdtool | |
parent | 6ed319a796b646894892e70a5757df84efea5785 (diff) |
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>
Diffstat (limited to 'util/ifdtool')
-rw-r--r-- | util/ifdtool/ifdtool.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index b5b0cd73bd..74588e12a3 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -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"); |