From a4090b5a61d7b86ee6b3a51090ec27cd7c10944c Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 11 Dec 2012 10:04:28 -0800 Subject: [PATCH] Addtional -h args to dump_fmap will ignore overlap errors. Snow was built with overlapping regions in its FMAP, so when we use dump_fmap -h to see what the layout is, it complains and dies. This change lets it keep going if you give it multiple -h args. Nothing else is different. BUG=none BRANCH=none TEST=manual This complains and quits: dump_fmap -h image-snow.bin This complains and keeps going: dump_fmap -hh image-snow.bin Change-Id: Ia4592b9ba6963b8c5064dd6f51625e9495db2845 Signed-off-by: Bill Richardson Reviewed-on: https://gerrit.chromium.org/gerrit/39551 Reviewed-by: Randall Spangler --- utility/dump_fmap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utility/dump_fmap.c b/utility/dump_fmap.c index 4d14d8b835..28fd2f2de5 100644 --- a/utility/dump_fmap.c +++ b/utility/dump_fmap.c @@ -22,6 +22,7 @@ enum { FMT_NORMAL, FMT_PRETTY, FMT_FLASHROM, FMT_HUMAN }; /* global variables */ static int opt_extract = 0; static int opt_format = FMT_NORMAL; +static int opt_overlap = 0; static char *progname; static void *base_of_rom; static int opt_gaps = 0; @@ -314,7 +315,10 @@ static int human_fmap(void *p) all_nodes[i].start, all_nodes[i].end); printf(" %s: 0x%x - 0x%x\n", all_nodes[j].name, all_nodes[j].start, all_nodes[j].end); - errorcnt++; + if (opt_overlap < 2) { + printf("Use more -h args to ignore this error\n"); + errorcnt++; + } continue; } if (encloses(j, i) && all_nodes[j].size < all_nodes[k].size) @@ -378,6 +382,7 @@ int main(int argc, char *argv[]) /* fallthrough */ case 'h': opt_format = FMT_HUMAN; + opt_overlap++; break; case '?': fprintf(stderr, "%s: unrecognized switch: -%c\n",