From eff596b51ad6691365d9e871772d72ff72614270 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sat, 8 Oct 2016 00:53:09 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/16936 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- util/ifdtool/ifdtool.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'util/ifdtool') 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"); -- cgit v1.2.3