Explain why BuildImage failed.
BuildImage can return false for lots of reasons. Log two of the more
plausible ones. You'll still need to edit this file and pass True to
RunCommand to work out *what* went wrong, but at least this logging will
tell you *where* things went wrong.
Bug: http://b/63142920
Test: debugged my actual problem
Change-Id: If84427058108dcac0a1b5e2216b8bb11eef522ca
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index e11f5a6..3770a79 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -548,6 +548,7 @@
if base_fs_file is not None:
os.remove(base_fs_file)
if exit_code != 0:
+ print("Error: '%s' failed with exit code %d" % (build_command, exit_code))
return False
# Bug: 21522719, 22023465
@@ -625,7 +626,11 @@
os.remove(unsparse_image)
- return exit_code == 0
+ if exit_code != 0:
+ print("Error: '%s' failed with exit code %d" % (e2fsck_command, exit_code))
+ return False
+
+ return True
def ImagePropFromGlobalDict(glob_dict, mount_point):