diff options
author | Simon Glass <sjg@chromium.org> | 2018-09-14 04:57:36 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-09-29 11:49:35 -0600 |
commit | 163ed6c342cfd15b623a46f3755203c712374a9a (patch) | |
tree | 5de0842cb24244db853f5253f84b865a8668206a /tools/binman/control.py | |
parent | fe1ae3ecc3a2203babd7837bd2d5cf514a374c1f (diff) | |
download | u-boot-163ed6c342cfd15b623a46f3755203c712374a9a.tar.gz u-boot-163ed6c342cfd15b623a46f3755203c712374a9a.tar.xz u-boot-163ed6c342cfd15b623a46f3755203c712374a9a.zip |
binman: Allow writing a map file when something goes wrong
When we get a problem like overlapping regions it is sometimes hard to
figure what what is going on. At present we don't write the map file in
this case. However the file does provide useful information.
Catch any packing errors and write a map file (if enabled with -m) to aid
debugging.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/control.py')
-rw-r--r-- | tools/binman/control.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py index caa194c899..3446e2e79c 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -163,9 +163,15 @@ def Binman(options, args): # completed and written, but that does not seem important. image.GetEntryContents() image.GetEntryOffsets() - image.PackEntries() - image.CheckSize() - image.CheckEntries() + try: + image.PackEntries() + image.CheckSize() + image.CheckEntries() + except Exception as e: + if options.map: + fname = image.WriteMap() + print "Wrote map file '%s' to show errors" % fname + raise image.SetImagePos() if options.update_fdt: image.SetCalculatedProperties() |