diff options
-rw-r--r-- | core/build_id.mk | 2 | ||||
-rw-r--r-- | core/definitions.mk | 23 | ||||
-rw-r--r-- | core/tasks/sts-lite.mk | 40 | ||||
-rw-r--r-- | core/version_defaults.mk | 2 | ||||
-rw-r--r-- | tools/releasetools/apex_utils.py | 32 |
5 files changed, 81 insertions, 18 deletions
diff --git a/core/build_id.mk b/core/build_id.mk index 24397784a3..07de0a4d9d 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. -BUILD_ID=331111000 +BUILD_ID=331310000 diff --git a/core/definitions.mk b/core/definitions.mk index 0b9263ee8d..8c2cbc967d 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -570,7 +570,7 @@ endef ## Target directory for license metadata files. ########################################################### define license-metadata-dir -$(call generated-sources-dir-for,META,lic,) +$(call generated-sources-dir-for,META,lic,$(filter-out $(PRODUCT_OUT)%,$(1))) endef TARGETS_MISSING_LICENSE_METADATA:= @@ -595,7 +595,7 @@ endef ## license metadata. ########################################################### define declare-copy-target-license-metadata -$(strip $(if $(filter $(OUT_DIR)%,$(2)),$(eval _dir:=$(call license-metadata-dir))\ +$(strip $(if $(filter $(OUT_DIR)%,$(2)),$(eval _dir:=$(call license-metadata-dir,$(1)))\ $(eval _tgt:=$(strip $(1)))\ $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(_tgt).meta_lic)))\ $(eval ALL_COPIED_TARGETS.$(_tgt).SOURCES := $(ALL_COPIED_TARGETS.$(_tgt).SOURCES) $(filter $(OUT_DIR)%,$(2)))\ @@ -675,7 +675,7 @@ endef ## License metadata build rule for non-module target $(1) ########################################################### define non-module-license-metadata-rule -$(strip $(eval _dir := $(call license-metadata-dir))) +$(strip $(eval _dir := $(call license-metadata-dir,$(1)))) $(strip $(eval _tgt := $(strip $(1)))) $(strip $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(_tgt).meta_lic)))) $(strip $(eval _deps := $(sort $(filter-out 0p: :,$(foreach d,$(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES)),$(ALL_TARGETS.$(call word-colon,1,$(d)).META_LIC):$(call wordlist-colon,2,9999,$(d))))))) @@ -738,7 +738,7 @@ $(if $(strip $(ALL_TARGETS.$(1).META_LIC)),,$(call _copied-target-license-metada endef define _copied-target-license-metadata-rule -$(strip $(eval _dir := $(call license-metadata-dir))) +$(strip $(eval _dir := $(call license-metadata-dir,$(1)))) $(strip $(eval _meta := $(call append-path,$(_dir),$(patsubst $(OUT_DIR)%,out%,$(1).meta_lic)))) $(strip $(eval ALL_TARGETS.$(1).META_LIC:=$(_meta))) $(strip $(eval _dep:=)) @@ -785,7 +785,7 @@ define declare-license-metadata $(strip \ $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_KINDS := $(strip $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS := $(strip $(3))) \ $(eval ALL_NON_MODULES.$(_tgt).NOTICES := $(strip $(4))) \ @@ -826,7 +826,7 @@ define declare-container-license-metadata $(strip \ $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_KINDS := $(strip $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).LICENSE_CONDITIONS := $(strip $(3))) \ $(eval ALL_NON_MODULES.$(_tgt).NOTICES := $(strip $(4))) \ @@ -897,9 +897,9 @@ endef ########################################################### define declare-license-deps $(strip \ - $(eval _tgt := $(strip $(1))) \ + $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ ) endef @@ -914,9 +914,9 @@ endef ########################################################### define declare-container-license-deps $(strip \ - $(eval _tgt := $(strip $(1))) \ + $(eval _tgt := $(subst //,/,$(strip $(1)))) \ $(eval ALL_NON_MODULES += $(_tgt)) \ - $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir)/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ + $(eval ALL_TARGETS.$(_tgt).META_LIC := $(call license-metadata-dir,$(1))/$(patsubst $(OUT_DIR)%,out%,$(_tgt)).meta_lic) \ $(eval ALL_NON_MODULES.$(_tgt).DEPENDENCIES := $(strip $(ALL_NON_MODULES.$(_tgt).DEPENDENCIES) $(2))) \ $(eval ALL_NON_MODULES.$(_tgt).IS_CONTAINER := true) \ $(eval ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS := $(strip $(ALL_NON_MODULES.$(_tgt).ROOT_MAPPINGS) $(3))) \ @@ -957,7 +957,7 @@ define report-all-notice-library-names-rule $(strip $(eval _all := $(call all-license-metadata))) .PHONY: reportallnoticelibrarynames -reportallnoticelibrarynames: PRIVATE_LIST_FILE := $(call license-metadata-dir)/filelist +reportallnoticelibrarynames: PRIVATE_LIST_FILE := $(call license-metadata-dir,COMMON)/filelist reportallnoticelibrarynames: | $(COMPLIANCENOTICE_SHIPPEDLIBS) reportallnoticelibrarynames: $(_all) @echo Reporting notice library names for at least $$(words $(_all)) license metadata files @@ -984,7 +984,6 @@ endef ########################################################### define build-license-metadata $(strip \ - $(strip $(eval _dir := $(call license-metadata-dir))) \ $(foreach t,$(sort $(ALL_0P_TARGETS)), \ $(eval ALL_TARGETS.$(t).META_LIC := 0p) \ ) \ diff --git a/core/tasks/sts-lite.mk b/core/tasks/sts-lite.mk new file mode 100644 index 0000000000..dee25d4802 --- /dev/null +++ b/core/tasks/sts-lite.mk @@ -0,0 +1,40 @@ +# Copyright (C) 2022 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ifneq ($(wildcard test/sts/README-sts-sdk.md),) +test_suite_name := sts-lite +test_suite_tradefed := sts-tradefed +test_suite_readme := test/sts/README-sts-sdk.md +sts_sdk_zip := $(HOST_OUT)/$(test_suite_name)/sts-sdk.zip + +include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk + +sts_sdk_samples := $(call intermediates-dir-for,ETC,sts-sdk-samples.zip)/sts-sdk-samples.zip + +$(sts_sdk_zip): STS_LITE_ZIP := $(compatibility_zip) +$(sts_sdk_zip): STS_SDK_SAMPLES := $(sts_sdk_samples) +$(sts_sdk_zip): $(MERGE_ZIPS) $(ZIP2ZIP) $(compatibility_zip) $(sts_sdk_samples) + rm -f $@ $(STS_LITE_ZIP)_filtered + $(ZIP2ZIP) -i $(STS_LITE_ZIP) -o $(STS_LITE_ZIP)_filtered \ + -x android-sts-lite/tools/sts-tradefed-tests.jar \ + 'android-sts-lite/tools/*:sts-test/libs/' \ + 'android-sts-lite/testcases/*:sts-test/utils/' + $(MERGE_ZIPS) $@ $(STS_LITE_ZIP)_filtered $(STS_SDK_SAMPLES) + rm -f $(STS_LITE_ZIP)_filtered + +.PHONY: sts-sdk +sts-sdk: $(sts_sdk_zip) +$(call dist-for-goals, sts-sdk, $(sts_sdk_zip)) + +endif diff --git a/core/version_defaults.mk b/core/version_defaults.mk index ab79658354..feb643e701 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -103,7 +103,7 @@ ifndef PLATFORM_SECURITY_PATCH # It must be of the form "YYYY-MM-DD" on production devices. # It must match one of the Android Security Patch Level strings of the Public Security Bulletins. # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2022-11-05 + PLATFORM_SECURITY_PATCH := 2022-12-01 endif include $(BUILD_SYSTEM)/version_util.mk diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index 941edc600d..fbe90abace 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -63,6 +63,8 @@ class ApexApkSigner(object): self.codename_to_api_level_map = codename_to_api_level_map self.debugfs_path = os.path.join( OPTIONS.search_path, "bin", "debugfs_static") + self.fsckerofs_path = os.path.join( + OPTIONS.search_path, "bin", "fsck.erofs") self.avbtool = avbtool if avbtool else "avbtool" self.sign_tool = sign_tool @@ -80,8 +82,13 @@ class ApexApkSigner(object): "Couldn't find location of debugfs_static: " + "Path {} does not exist. ".format(self.debugfs_path) + "Make sure bin/debugfs_static can be found in -p <path>") - list_cmd = ['deapexer', '--debugfs_path', - self.debugfs_path, 'list', self.apex_path] + if not os.path.exists(self.fsckerofs_path): + raise ApexSigningError( + "Couldn't find location of fsck.erofs: " + + "Path {} does not exist. ".format(self.fsckerofs_path) + + "Make sure bin/fsck.erofs can be found in -p <path>") + list_cmd = ['deapexer', '--debugfs_path', self.debugfs_path, + '--fsckerofs_path', self.fsckerofs_path, 'list', self.apex_path] entries_names = common.RunAndCheckOutput(list_cmd).split() apk_entries = [name for name in entries_names if name.endswith('.apk')] @@ -116,9 +123,15 @@ class ApexApkSigner(object): "Couldn't find location of debugfs_static: " + "Path {} does not exist. ".format(self.debugfs_path) + "Make sure bin/debugfs_static can be found in -p <path>") + if not os.path.exists(self.fsckerofs_path): + raise ApexSigningError( + "Couldn't find location of fsck.erofs: " + + "Path {} does not exist. ".format(self.fsckerofs_path) + + "Make sure bin/fsck.erofs can be found in -p <path>") payload_dir = common.MakeTempDir() - extract_cmd = ['deapexer', '--debugfs_path', - self.debugfs_path, 'extract', self.apex_path, payload_dir] + extract_cmd = ['deapexer', '--debugfs_path', self.debugfs_path, + '--fsckerofs_path', self.fsckerofs_path, 'extract', + self.apex_path, payload_dir] common.RunAndCheckOutput(extract_cmd) has_signed_content = False @@ -417,6 +430,7 @@ def SignCompressedApex(avbtool, apex_file, payload_key, container_key, The path to the signed APEX file. """ debugfs_path = os.path.join(OPTIONS.search_path, 'bin', 'debugfs_static') + fsckerofs_path = os.path.join(OPTIONS.search_path, 'bin', 'fsck.erofs') # 1. Decompress original_apex inside compressed apex. original_apex_file = common.MakeTempFile(prefix='original-apex-', @@ -424,6 +438,7 @@ def SignCompressedApex(avbtool, apex_file, payload_key, container_key, # Decompression target path should not exist os.remove(original_apex_file) common.RunAndCheckOutput(['deapexer', '--debugfs_path', debugfs_path, + '--fsckerofs_path', fsckerofs_path, 'decompress', '--input', apex_file, '--output', original_apex_file]) @@ -487,7 +502,9 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw, output_fp.write(apex_data) debugfs_path = os.path.join(OPTIONS.search_path, 'bin', 'debugfs_static') + fsckerofs_path = os.path.join(OPTIONS.search_path, 'bin', 'fsck.erofs') cmd = ['deapexer', '--debugfs_path', debugfs_path, + '--fsckerofs_path', fsckerofs_path, 'info', '--print-type', apex_file] try: @@ -559,11 +576,17 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True): debugfs_path = "debugfs" if OPTIONS.search_path: debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static") + + fsckerofs_path = "fsck.erofs" + if OPTIONS.search_path: + fsckerofs_path = os.path.join(OPTIONS.search_path, "bin", "fsck.erofs") + deapexer = 'deapexer' if OPTIONS.search_path: deapexer_path = os.path.join(OPTIONS.search_path, "bin", "deapexer") if os.path.isfile(deapexer_path): deapexer = deapexer_path + for apex_filename in os.listdir(target_dir): apex_filepath = os.path.join(target_dir, apex_filename) if not os.path.isfile(apex_filepath) or \ @@ -578,6 +601,7 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True): # Check if the file is compressed or not apex_type = RunAndCheckOutput([ deapexer, "--debugfs_path", debugfs_path, + "--fsckerofs_path", fsckerofs_path, 'info', '--print-type', apex_filepath]).rstrip() if apex_type == 'COMPRESSED': apex_info.is_compressed = True |