summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-10-13 16:37:12 -0700
committerTao Bao <tbao@google.com>2015-10-16 15:47:51 -0700
commite09359abc0f8c29fbb16d35ab7375d80fde6f931 (patch)
treeca9ce74b5c89b7f5d0b78d7671cf033015d5e584 /tools
parentb16edb5f3ef9032b7e19c29aac2496c34bb8ac76 (diff)
downloadbuild-e09359abc0f8c29fbb16d35ab7375d80fde6f931.zip
build-e09359abc0f8c29fbb16d35ab7375d80fde6f931.tar.gz
build-e09359abc0f8c29fbb16d35ab7375d80fde6f931.tar.bz2
DO NOT MERGE Pass source's info_dict to vendor's releasetools.py.
When building incremental packages, the info_dict from the source build should be the one in use. We have done that for most of the partitions (system and etc.), and should pass that to vendor's script as well. Also includes the CL in commit aac4ad56b6c60e271d807604b20f72084c58b426 that fixes a bug in commit 6f0b219ac551710c724e3f344023943178cdc217. Bug: 24898607 Change-Id: I4ea6037dad7061e1683661fc4c394fa3a7a7c5cd (cherry picked from commit 6f0b219ac551710c724e3f344023943178cdc217)
Diffstat (limited to 'tools')
-rw-r--r--tools/releasetools/common.py10
-rwxr-xr-xtools/releasetools/ota_from_target_files.py4
2 files changed, 11 insertions, 3 deletions
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 99b319d..27b8f27 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -59,6 +59,8 @@ class Options(object):
self.device_specific = None
self.extras = {}
self.info_dict = None
+ self.source_info_dict = None
+ self.target_info_dict = None
self.worker_threads = None
@@ -1193,7 +1195,11 @@ class BlockDifference(object):
self.path = os.path.join(tmpdir, partition)
b.Compute(self.path)
- _, self.device = GetTypeAndDevice("/" + partition, OPTIONS.info_dict)
+ if src is None:
+ _, self.device = GetTypeAndDevice("/" + partition, OPTIONS.info_dict)
+ else:
+ _, self.device = GetTypeAndDevice("/" + partition,
+ OPTIONS.source_info_dict)
def WriteScript(self, script, output_zip, progress=None):
if not self.src:
@@ -1391,6 +1397,8 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
output_sink("recovery-from-boot.p", patch)
try:
+ # The following GetTypeAndDevice()s need to use the path in the target
+ # info_dict instead of source_info_dict.
boot_type, boot_device = GetTypeAndDevice("/boot", info_dict)
recovery_type, recovery_device = GetTypeAndDevice("/recovery", info_dict)
except KeyError:
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index b148fc1..c6fd47e 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -753,7 +753,7 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
output_zip=output_zip,
script=script,
metadata=metadata,
- info_dict=OPTIONS.info_dict)
+ info_dict=OPTIONS.source_info_dict)
# TODO: Currently this works differently from WriteIncrementalOTAPackage().
# This function doesn't consider thumbprints when writing
@@ -1153,7 +1153,7 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
output_zip=output_zip,
script=script,
metadata=metadata,
- info_dict=OPTIONS.info_dict)
+ info_dict=OPTIONS.source_info_dict)
system_diff = FileDifference("system", source_zip, target_zip, output_zip)
script.Mount("/system", recovery_mount_options)