Merge "squashfs: make disable-4k-align a parameter" into nyc-dev
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 2a7ffb7..9410c3c 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -11,6 +11,10 @@
DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
endif
+# Pass special classpath to skip uses library check.
+# Should modify build system to pass used libraries properly later.
+DEX2OAT_CLASSPATH := "&"
+
DEX2OAT_DEPENDENCY += $(DEX2OAT)
# Use the first preloaded-classes file in PRODUCT_COPY_FILES.
@@ -94,6 +98,7 @@
$(hide) mkdir -p $(dir $(2))
$(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) \
--runtime-arg -Xms$(DEX2OAT_XMS) --runtime-arg -Xmx$(DEX2OAT_XMX) \
+ --runtime-arg -classpath --runtime-arg $(DEX2OAT_CLASSPATH) \
--boot-image=$(PRIVATE_DEX_PREOPT_IMAGE_LOCATION) \
--dex-file=$(1) \
--dex-location=$(PRIVATE_DEX_LOCATION) \
diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py
index 82d5397..a7a4098 100644
--- a/tools/releasetools/blockimgdiff.py
+++ b/tools/releasetools/blockimgdiff.py
@@ -261,7 +261,8 @@
# original image.
class BlockImageDiff(object):
- def __init__(self, tgt, src=None, threads=None, version=4):
+ def __init__(self, tgt, src=None, threads=None, version=4,
+ disable_imgdiff=False):
if threads is None:
threads = multiprocessing.cpu_count() // 2
if threads == 0:
@@ -274,6 +275,7 @@
self._max_stashed_size = 0
self.touched_src_ranges = RangeSet()
self.touched_src_sha1 = None
+ self.disable_imgdiff = disable_imgdiff
assert version in (1, 2, 3, 4)
@@ -714,6 +716,7 @@
# produces significantly smaller patches than bsdiff).
# This is permissible if:
#
+ # - imgdiff is not disabled, and
# - the source and target files are monotonic (ie, the
# data is stored with blocks in increasing order), and
# - we haven't removed any blocks from the source set.
@@ -723,7 +726,7 @@
# zip file (plus possibly extra zeros in the last block),
# which is what imgdiff needs to operate. (imgdiff is
# fine with extra zeros at the end of the file.)
- imgdiff = (xf.intact and
+ imgdiff = (not self.disable_imgdiff and xf.intact and
xf.tgt_name.split(".")[-1].lower()
in ("apk", "jar", "zip"))
xf.style = "imgdiff" if imgdiff else "bsdiff"
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index b5c0114..422ba43 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -1341,11 +1341,12 @@
class BlockDifference(object):
def __init__(self, partition, tgt, src=None, check_first_block=False,
- version=None):
+ version=None, disable_imgdiff=False):
self.tgt = tgt
self.src = src
self.partition = partition
self.check_first_block = check_first_block
+ self.disable_imgdiff = disable_imgdiff
if version is None:
version = 1
@@ -1356,7 +1357,8 @@
self.version = version
b = blockimgdiff.BlockImageDiff(tgt, src, threads=OPTIONS.worker_threads,
- version=self.version)
+ version=self.version,
+ disable_imgdiff=self.disable_imgdiff)
tmpdir = tempfile.mkdtemp()
OPTIONS.tempfiles.append(tmpdir)
self.path = os.path.join(tmpdir, partition)
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 861c485..b69ddac 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -834,6 +834,10 @@
OPTIONS.target_info_dict)
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
+ metadata["pre-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.source_info_dict)
+ metadata["post-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.target_info_dict)
source_boot = common.GetBootableImage(
"/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT",
@@ -859,9 +863,15 @@
# disk type is ext4
system_partition = OPTIONS.source_info_dict["fstab"]["/system"]
check_first_block = system_partition.fs_type == "ext4"
+ # Disable using imgdiff for squashfs. 'imgdiff -z' expects input files to be
+ # in zip formats. However with squashfs, a) all files are compressed in LZ4;
+ # b) the blocks listed in block map may not contain all the bytes for a given
+ # file (because they're rounded to be 4K-aligned).
+ disable_imgdiff = system_partition.fs_type == "squashfs"
system_diff = common.BlockDifference("system", system_tgt, system_src,
check_first_block,
- version=blockimgdiff_version)
+ version=blockimgdiff_version,
+ disable_imgdiff=disable_imgdiff)
if HasVendorPartition(target_zip):
if not HasVendorPartition(source_zip):
@@ -875,9 +885,11 @@
# disk type is ext4
vendor_partition = OPTIONS.source_info_dict["fstab"]["/vendor"]
check_first_block = vendor_partition.fs_type == "ext4"
+ disable_imgdiff = vendor_partition.fs_type == "squashfs"
vendor_diff = common.BlockDifference("vendor", vendor_tgt, vendor_src,
check_first_block,
- version=blockimgdiff_version)
+ version=blockimgdiff_version,
+ disable_imgdiff=disable_imgdiff)
else:
vendor_diff = None
@@ -1178,6 +1190,8 @@
metadata = {
"post-build": CalculateFingerprint(oem_props, oem_dict,
OPTIONS.info_dict),
+ "post-build-incremental" : GetBuildProp("ro.build.version.incremental",
+ OPTIONS.info_dict),
"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
OPTIONS.info_dict),
"post-timestamp": GetBuildProp("ro.build.date.utc", OPTIONS.info_dict),
@@ -1188,6 +1202,8 @@
if source_file is not None:
metadata["pre-build"] = CalculateFingerprint(oem_props, oem_dict,
OPTIONS.source_info_dict)
+ metadata["pre-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.source_info_dict)
# 1. Generate payload.
payload_file = common.MakeTempFile(prefix="payload-", suffix=".bin")
@@ -1493,6 +1509,10 @@
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
+ metadata["pre-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.source_info_dict)
+ metadata["post-build-incremental"] = GetBuildProp(
+ "ro.build.version.incremental", OPTIONS.target_info_dict)
source_boot = common.GetBootableImage(
"/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT",