aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-12 18:13:11 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-12 18:16:15 +0000
commit146dde89a7fa69f55409c05bcd3116e7437309e4 (patch)
tree9f9771cc6beceb9edf5a4bb901f2dc666a426363
parentff644e386183a34c66a452fffcd2ef2403e4ab9e (diff)
parent35c4eab6d4eedbb607bc2c142c59fb3fb330c16e (diff)
downloadplatform_build-146dde89a7fa69f55409c05bcd3116e7437309e4.tar.gz
platform_build-146dde89a7fa69f55409c05bcd3116e7437309e4.tar.bz2
platform_build-146dde89a7fa69f55409c05bcd3116e7437309e4.zip
Make change and version bump to OPM2.170911.002
Change-Id: I1b375a609635bea017406f8ed996f94474fe99ae
-rw-r--r--core/build_id.mk2
-rw-r--r--core/package_internal.mk13
-rw-r--r--core/product.mk1
-rw-r--r--core/product_config.mk4
-rw-r--r--target/board/generic_arm64_ab/BoardConfig.mk2
-rw-r--r--target/board/generic_arm64_ab/sepolicy/file.te1
-rw-r--r--target/board/generic_arm64_ab/sepolicy/file_contexts1
-rw-r--r--target/product/treble_common.mk7
-rw-r--r--tools/releasetools/common.py12
-rwxr-xr-xtools/releasetools/validate_target_files.py22
10 files changed, 48 insertions, 17 deletions
diff --git a/core/build_id.mk b/core/build_id.mk
index 4892059d0b..deace44bf5 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -18,4 +18,4 @@
# (like "CRB01"). It must be a single word, and is
# capitalized by convention.
-export BUILD_ID=OPM1.170907.001
+export BUILD_ID=OPM2.170911.002
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 87a15d23fe..5c4ad28661 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -122,7 +122,18 @@ ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),)
endif
endif
-ifndef enforce_rro_enabled
+ifdef enforce_rro_enabled
+ ifneq ($(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS),)
+ static_only_resource_overlays := $(filter $(addsuffix %,$(PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS)),$(package_resource_overlays))
+ ifneq ($(static_only_resource_overlays),)
+ package_resource_overlays := $(filter-out $(static_only_resource_overlays),$(package_resource_overlays))
+ LOCAL_RESOURCE_DIR := $(static_only_resource_overlays) $(LOCAL_RESOURCE_DIR)
+ ifeq ($(package_resource_overlays),)
+ enforce_rro_enabled :=
+ endif
+ endif
+ endif
+else
LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR)
endif
diff --git a/core/product.mk b/core/product.mk
index 8f7db19efd..c955ccc061 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -94,6 +94,7 @@ _product_var_list := \
PRODUCT_EXTRA_RECOVERY_KEYS \
PRODUCT_PACKAGE_OVERLAYS \
DEVICE_PACKAGE_OVERLAYS \
+ PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS \
PRODUCT_ENFORCE_RRO_TARGETS \
PRODUCT_SDK_ATREE_FILES \
PRODUCT_SDK_ADDON_NAME \
diff --git a/core/product_config.mk b/core/product_config.mk
index 6812b05d48..cd62fb2e41 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -434,6 +434,10 @@ PRODUCT_ART_USE_READ_BARRIER := \
PRODUCT_IOT := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_IOT))
+# Resource overlay list which must be excluded from enforcing RRO.
+PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \
+ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS))
+
# Package list to apply enforcing RRO.
PRODUCT_ENFORCE_RRO_TARGETS := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_RRO_TARGETS))
diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk
index e69debe501..22b9f429fe 100644
--- a/target/board/generic_arm64_ab/BoardConfig.mk
+++ b/target/board/generic_arm64_ab/BoardConfig.mk
@@ -33,7 +33,7 @@ TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
# TODO(jiyong) These might be SoC specific.
-BOARD_ROOT_EXTRA_FOLDERS += bt_firmware firmware firmware/radio persist
+BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist
BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp
# TODO(b/36764215): remove this setting when the generic system image
diff --git a/target/board/generic_arm64_ab/sepolicy/file.te b/target/board/generic_arm64_ab/sepolicy/file.te
index 46455339a0..7adfdfa4e6 100644
--- a/target/board/generic_arm64_ab/sepolicy/file.te
+++ b/target/board/generic_arm64_ab/sepolicy/file.te
@@ -1,6 +1,5 @@
# TODO(b/36764215): remove this file when the generic system image
# no longer has these directories
-type bt_firmware_file, file_type;
type persist_file, file_type;
# Default type for anything under /firmware.
diff --git a/target/board/generic_arm64_ab/sepolicy/file_contexts b/target/board/generic_arm64_ab/sepolicy/file_contexts
index 92a4ff8726..0a80559e17 100644
--- a/target/board/generic_arm64_ab/sepolicy/file_contexts
+++ b/target/board/generic_arm64_ab/sepolicy/file_contexts
@@ -2,7 +2,6 @@
# no longer has these directories. They are specific to QCOM.
# /
-/bt_firmware(/.*)? u:object_r:bt_firmware_file:s0
/tombstones u:object_r:rootfs:s0
/dsp u:object_r:rootfs:s0
diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk
index 1c38b02a68..f885646adc 100644
--- a/target/product/treble_common.mk
+++ b/target/product/treble_common.mk
@@ -58,13 +58,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
netutils-wrapper-1.0
-# A workaround solution for some projects which require
-# TimeZoneRulesManagerService by overlaying resource property
-# "config_enableUpdateableTimeZoneRules"
-PRODUCT_PACKAGES += \
- TimeZoneUpdater \
- TimeZoneData \
-
# Android Verified Boot (AVB):
# Builds a special vbmeta.img that disables AVB verification.
# Otherwise, AVB will prevent the device from booting the generic system.img.
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 9d58954d2d..34c334e40f 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -772,6 +772,14 @@ def ReadApkCerts(tf_zip):
certmap = {}
compressed_extension = None
+ # META/apkcerts.txt contains the info for _all_ the packages known at build
+ # time. Filter out the ones that are not installed.
+ installed_files = set()
+ for name in tf_zip.namelist():
+ basename = os.path.basename(name)
+ if basename:
+ installed_files.add(basename)
+
for line in tf_zip.read("META/apkcerts.txt").split("\n"):
line = line.strip()
if not line:
@@ -796,6 +804,10 @@ def ReadApkCerts(tf_zip):
else:
raise ValueError("failed to parse line from apkcerts.txt:\n" + line)
if this_compressed_extension:
+ # Only count the installed files.
+ filename = name + '.' + this_compressed_extension
+ if filename not in installed_files:
+ continue
# Make sure that all the values in the compression map have the same
# extension. We don't support multiple compression methods in the same
# system image.
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 8ac3322c63..4b34820c89 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -44,8 +44,8 @@ def _GetImage(which, tmpdir):
return sparse_img.SparseImage(path, mappath, clobbered_blocks)
-def _CalculateFileSha1(file_name, unpacked_name, round_up=False):
- """Calculate the SHA-1 for a given file. Round up its size to 4K if needed."""
+def _ReadFile(file_name, unpacked_name, round_up=False):
+ """Constructs and returns a File object. Rounds up its size if needed."""
def RoundUpTo4K(value):
rounded_up = value + 4095
@@ -58,7 +58,7 @@ def _CalculateFileSha1(file_name, unpacked_name, round_up=False):
if round_up:
file_size_rounded_up = RoundUpTo4K(file_size)
file_data += '\0' * (file_size_rounded_up - file_size)
- return common.File(file_name, file_data).sha1
+ return common.File(file_name, file_data)
def ValidateFileAgainstSha1(input_tmp, file_name, file_path, expected_sha1):
@@ -67,7 +67,7 @@ def ValidateFileAgainstSha1(input_tmp, file_name, file_path, expected_sha1):
logging.info('Validating the SHA-1 of {}'.format(file_name))
unpacked_name = os.path.join(input_tmp, file_path)
assert os.path.exists(unpacked_name)
- actual_sha1 = _CalculateFileSha1(file_name, unpacked_name, False)
+ actual_sha1 = _ReadFile(file_name, unpacked_name, False).sha1
assert actual_sha1 == expected_sha1, \
'SHA-1 mismatches for {}. actual {}, expected {}'.format(
file_name, actual_sha1, expected_sha1)
@@ -92,8 +92,20 @@ def ValidateFileConsistency(input_zip, input_tmp):
# The filename under unpacked directory, such as SYSTEM/bin/sh.
unpacked_name = os.path.join(
input_tmp, which.upper(), entry[(len(prefix) + 1):])
- file_sha1 = _CalculateFileSha1(entry, unpacked_name, True)
+ unpacked_file = _ReadFile(entry, unpacked_name, True)
+ file_size = unpacked_file.size
+
+ # block.map may contain less blocks, because mke2fs may skip allocating
+ # blocks if they contain all zeros. We can't reconstruct such a file from
+ # its block list. (Bug: 65213616)
+ if file_size > ranges.size() * 4096:
+ logging.warning(
+ 'Skipping %s that has less blocks: file size %d-byte,'
+ ' ranges %s (%d-byte)', entry, file_size, ranges,
+ ranges.size() * 4096)
+ continue
+ file_sha1 = unpacked_file.sha1
assert blocks_sha1 == file_sha1, \
'file: %s, range: %s, blocks_sha1: %s, file_sha1: %s' % (
entry, ranges, blocks_sha1, file_sha1)