summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-12-11 10:04:28 -0800
committerGerrit <chrome-bot@google.com>2012-12-11 11:13:12 -0800
commita4090b5a61d7b86ee6b3a51090ec27cd7c10944c (patch)
treea50731454467c1606343db9d0137d9e1f22fe6f8
parent34d515c5c19fb2ca79d212eb7fa837a455a20321 (diff)
downloadvboot-a4090b5a61d7b86ee6b3a51090ec27cd7c10944c.tar.gz
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>
-rw-r--r--utility/dump_fmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/utility/dump_fmap.c b/utility/dump_fmap.c
index 4d14d8b8..28fd2f2d 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",