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 <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39551
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2012-12-11 10:04:28 -08:00
committed by Gerrit
parent 34d515c5c1
commit a4090b5a61

View File

@@ -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);
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",