summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralk3pInjection <webmaster@raspii.tech>2021-09-11 17:40:20 +0800
committeralk3pInjection <webmaster@raspii.tech>2021-09-27 21:17:05 +0800
commit954e280bea9938d91c7a50cd48f9c15156b6c0fa (patch)
tree4636c259d1b6e176f2b730b42c5ef183a0f79f75
parent6100d11267549ce4374ad2b0d032cda82484e217 (diff)
releasetools: Properly handle map files
For squashfs or erofs, we currently don't have a system.map. Instead of bailing out, set the mappath to None to fix build. Change-Id: Ie04c060177f39d0e0cf711d28ea38b11dc40d3ab Signed-off-by: alk3pInjection <webmaster@raspii.tech>
-rw-r--r--tools/releasetools/common.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 76c2c97cb9..e40cbd75a3 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -1614,7 +1614,9 @@ def GetNonSparseImage(which, tmpdir, hashtree_info_generator=None):
# The image and map files must have been created prior to calling
# ota_from_target_files.py (since LMP).
- assert os.path.exists(path) and os.path.exists(mappath)
+ assert os.path.exists(path)
+ if not os.path.exists(mappath):
+ mappath = None
return images.FileImage(path, hashtree_info_generator=hashtree_info_generator)
@@ -1643,7 +1645,9 @@ def GetSparseImage(which, tmpdir, input_zip, allow_shared_blocks,
# The image and map files must have been created prior to calling
# ota_from_target_files.py (since LMP).
- assert os.path.exists(path) and os.path.exists(mappath)
+ assert os.path.exists(path)
+ if not os.path.exists(mappath):
+ mappath = None
# In ext4 filesystems, block 0 might be changed even being mounted R/O. We add
# it to clobbered_blocks so that it will be written to the target