diff options
Diffstat (limited to 'tools/releasetools/common.py')
-rw-r--r-- | tools/releasetools/common.py | 8 |
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 |