diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-05 18:55:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-05-05 18:55:09 +0000 |
commit | 55df3d8c6590c6b4ff46a75357aac49b86a1003a (patch) | |
tree | 75e425b2a51d10c31b23d477ee3d6a2bc4ce4df1 | |
parent | 00bf0e7e3992f8df82dadce41e5a6e6208f10221 (diff) | |
parent | 62a602551228b18258f04f68074d1fb002751b77 (diff) | |
download | build-55df3d8c6590c6b4ff46a75357aac49b86a1003a.tar.gz |
Merge "Make change and version bump to AAQ4.220505.001" into main-cg-testing-release
-rw-r--r-- | core/Makefile | 2 | ||||
-rw-r--r-- | core/android_manifest.mk | 14 | ||||
-rw-r--r-- | core/board_config.mk | 5 | ||||
-rw-r--r-- | core/build_id.mk | 2 | ||||
-rw-r--r-- | core/config.mk | 1 | ||||
-rw-r--r-- | core/product_config.mk | 1 | ||||
-rw-r--r-- | core/version_defaults.mk | 2 | ||||
-rw-r--r-- | envsetup.sh | 6 | ||||
-rwxr-xr-x | finalize_branch_for_release.sh | 3 | ||||
-rw-r--r-- | tools/releasetools/common.py | 14 | ||||
-rw-r--r-- | tools/releasetools/merge/merge_utils.py | 118 | ||||
-rw-r--r-- | tools/releasetools/merge/test_merge_utils.py | 36 | ||||
-rwxr-xr-x | tools/releasetools/ota_from_target_files.py | 2 | ||||
-rw-r--r-- | tools/releasetools/ota_utils.py | 17 |
14 files changed, 149 insertions, 74 deletions
diff --git a/core/Makefile b/core/Makefile index 72929bf77c..94b48039bf 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5374,7 +5374,7 @@ $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_OTA_TOOLS := $(built_ota_tools) tool_extension := $(wildcard $(tool_extensions)/releasetools.py) $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_TOOL_EXTENSION := $(tool_extension) -updaer_dep := +updater_dep := ifeq ($(AB_OTA_UPDATER),true) updater_dep += system/update_engine/update_engine.conf $(call declare-1p-target,system/update_engine/update_engine.conf,system/update_engine) diff --git a/core/android_manifest.mk b/core/android_manifest.mk index 254e09bc93..ff4926285f 100644 --- a/core/android_manifest.mk +++ b/core/android_manifest.mk @@ -87,13 +87,23 @@ ifeq ($(LOCAL_MODULE_CLASS),APPS) endif endif +# TODO: Replace this hardcoded list of optional uses-libraries with build logic +# that propagates optionality via the generated exported-sdk-libs files. +# Hardcodng doesn't scale and enforces a single choice on each library, while in +# reality this is a choice of the library users (which may differ). +my_optional_sdk_lib_names := \ + android.test.base \ + android.test.mock \ + androidx.window.extensions \ + androidx.window.sidecar + $(fixed_android_manifest): PRIVATE_MANIFEST_FIXER_FLAGS := $(my_manifest_fixer_flags) # These two libs are added as optional dependencies (<uses-library> with # android:required set to false). This is because they haven't existed in pre-P # devices, but classes in them were in bootclasspath jars, etc. So making them # hard dependencies (andriod:required=true) would prevent apps from being # installed to such legacy devices. -$(fixed_android_manifest): PRIVATE_OPTIONAL_SDK_LIB_NAMES := android.test.base android.test.mock +$(fixed_android_manifest): PRIVATE_OPTIONAL_SDK_LIB_NAMES := $(my_optional_sdk_lib_names) $(fixed_android_manifest): $(MANIFEST_FIXER) $(fixed_android_manifest): $(main_android_manifest) echo $(PRIVATE_OPTIONAL_SDK_LIB_NAMES) | tr ' ' '\n' > $(PRIVATE_EXPORTED_SDK_LIBS_FILE).optional @@ -109,3 +119,5 @@ $(fixed_android_manifest): $(main_android_manifest) ) \ $< $@ rm $(PRIVATE_EXPORTED_SDK_LIBS_FILE).optional + +my_optional_sdk_lib_names := diff --git a/core/board_config.mk b/core/board_config.mk index dc50a689ad..8074225ba1 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -234,10 +234,7 @@ else .KATI_READONLY := TARGET_DEVICE_DIR endif -# TODO(colefaust) change this if to RBC_PRODUCT_CONFIG when -# the board configuration is known to work on everything -# the product config works on. -ifndef RBC_BOARD_CONFIG +ifndef RBC_PRODUCT_CONFIG include $(board_config_mk) else $(shell mkdir -p $(OUT_DIR)/rbc) diff --git a/core/build_id.mk b/core/build_id.mk index 373b217e96..65779643ed 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=AAQ4.220502.001 +BUILD_ID=AAQ4.220505.001 diff --git a/core/config.mk b/core/config.mk index e9dedfdfa6..4db33f155e 100644 --- a/core/config.mk +++ b/core/config.mk @@ -861,6 +861,7 @@ PLATFORM_SEPOLICY_COMPAT_VERSIONS := \ 30.0 \ 31.0 \ 32.0 \ + 33.0 \ .KATI_READONLY := \ PLATFORM_SEPOLICY_COMPAT_VERSIONS \ diff --git a/core/product_config.mk b/core/product_config.mk index 1e74fa9562..35f018daea 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -230,7 +230,6 @@ endif ifneq (,$(filter $(TARGET_PRODUCT),$(products_using_starlark_config))) RBC_PRODUCT_CONFIG := true - RBC_BOARD_CONFIG := true endif ifndef RBC_PRODUCT_CONFIG diff --git a/core/version_defaults.mk b/core/version_defaults.mk index d129aa440f..af7d1c06d3 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -104,7 +104,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-04-05 + PLATFORM_SECURITY_PATCH := 2022-05-05 endif .KATI_READONLY := PLATFORM_SECURITY_PATCH diff --git a/envsetup.sh b/envsetup.sh index e7b85382d0..b49bb8a21e 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -395,7 +395,7 @@ function addcompletions() fi local completion_files=( - system/core/adb/adb.bash + packages/modules/adb/adb.bash system/core/fastboot/fastboot.bash tools/asuite/asuite.sh ) @@ -404,7 +404,9 @@ function addcompletions() # ENVSETUP_NO_COMPLETION=adb # -> disable adb completion # ENVSETUP_NO_COMPLETION=adb:bit # -> disable adb and bit completion for f in ${completion_files[*]}; do - if [ -f "$f" ] && should_add_completion "$f"; then + if [ ! -f "$f" ]; then + echo "Warning: completion file $f not found" + elif should_add_completion "$f"; then . $f fi done diff --git a/finalize_branch_for_release.sh b/finalize_branch_for_release.sh index c942eb2e54..8587b3aabc 100755 --- a/finalize_branch_for_release.sh +++ b/finalize_branch_for_release.sh @@ -17,7 +17,8 @@ set -x # Update references in the codebase to new API version (TODO) # ... -AIDL_TRANSITIVE_FREEZE=true m aidl-freeze-api +# Adding -j1 option because of file(Android.bp) race condition. +AIDL_TRANSITIVE_FREEZE=true m aidl-freeze-api -j1 m check-vndk-list || update-vndk-list.sh # for new versions of AIDL interfaces diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 5f74e2b818..374babfce4 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -725,7 +725,7 @@ class RamdiskFormat(object): GZ = 2 -def _GetRamdiskFormat(info_dict): +def GetRamdiskFormat(info_dict): if info_dict.get('lz4_ramdisks') == 'true': ramdisk_format = RamdiskFormat.LZ4 else: @@ -834,7 +834,7 @@ def LoadInfoDict(input_file, repacking=False): # Load recovery fstab if applicable. d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper) - ramdisk_format = _GetRamdiskFormat(d) + ramdisk_format = GetRamdiskFormat(d) # Tries to load the build props for all partitions with care_map, including # system and vendor. @@ -1188,10 +1188,14 @@ def MergeDynamicPartitionInfoDicts(framework_dict, vendor_dict): return " ".join(sorted(combined)) if (framework_dict.get("use_dynamic_partitions") != - "true") or (vendor_dict.get("use_dynamic_partitions") != "true"): + "true") or (vendor_dict.get("use_dynamic_partitions") != "true"): raise ValueError("Both dictionaries must have use_dynamic_partitions=true") merged_dict = {"use_dynamic_partitions": "true"} + # For keys-value pairs that are the same, copy to merged dict + for key in vendor_dict.keys(): + if key in framework_dict and framework_dict[key] == vendor_dict[key]: + merged_dict[key] = vendor_dict[key] merged_dict["dynamic_partition_list"] = uniq_concat( framework_dict.get("dynamic_partition_list", ""), @@ -1575,7 +1579,7 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None, img = tempfile.NamedTemporaryFile() if has_ramdisk: - ramdisk_format = _GetRamdiskFormat(info_dict) + ramdisk_format = GetRamdiskFormat(info_dict) ramdisk_img = _MakeRamdisk(sourcedir, fs_config_file, ramdisk_format=ramdisk_format) @@ -1856,7 +1860,7 @@ def _BuildVendorBootImage(sourcedir, partition_name, info_dict=None): img = tempfile.NamedTemporaryFile() - ramdisk_format = _GetRamdiskFormat(info_dict) + ramdisk_format = GetRamdiskFormat(info_dict) ramdisk_img = _MakeRamdisk(sourcedir, ramdisk_format=ramdisk_format) # use MKBOOTIMG from environ, or "mkbootimg" if empty or not set diff --git a/tools/releasetools/merge/merge_utils.py b/tools/releasetools/merge/merge_utils.py index f623ad2d4a..e253b02545 100644 --- a/tools/releasetools/merge/merge_utils.py +++ b/tools/releasetools/merge/merge_utils.py @@ -100,20 +100,16 @@ def ValidateConfigLists(): has_error = False # Check that partitions only come from one input. - for partition in _FRAMEWORK_PARTITIONS.union(_VENDOR_PARTITIONS): - image_path = 'IMAGES/{}.img'.format(partition.lower().replace('/', '')) - in_framework = ( - any(item.startswith(partition) for item in OPTIONS.framework_item_list) - or image_path in OPTIONS.framework_item_list) - in_vendor = ( - any(item.startswith(partition) for item in OPTIONS.vendor_item_list) or - image_path in OPTIONS.vendor_item_list) - if in_framework and in_vendor: - logger.error( - 'Cannot extract items from %s for both the framework and vendor' - ' builds. Please ensure only one merge config item list' - ' includes %s.', partition, partition) - has_error = True + framework_partitions = ItemListToPartitionSet(OPTIONS.framework_item_list) + vendor_partitions = ItemListToPartitionSet(OPTIONS.vendor_item_list) + from_both = framework_partitions.intersection(vendor_partitions) + if from_both: + logger.error( + 'Cannot extract items from the same partition in both the ' + 'framework and vendor builds. Please ensure only one merge config ' + 'item list (or inferred list) includes each partition: %s' % + ','.join(from_both)) + has_error = True if any([ key in OPTIONS.framework_misc_info_keys @@ -131,7 +127,8 @@ def ValidateConfigLists(): # system partition). The following regex matches this and extracts the # partition name. -_PARTITION_ITEM_PATTERN = re.compile(r'^([A-Z_]+)/\*$') +_PARTITION_ITEM_PATTERN = re.compile(r'^([A-Z_]+)/.*$') +_IMAGE_PARTITION_PATTERN = re.compile(r'^IMAGES/(.*)\.img$') def ItemListToPartitionSet(item_list): @@ -154,62 +151,89 @@ def ItemListToPartitionSet(item_list): partition_set = set() for item in item_list: - partition_match = _PARTITION_ITEM_PATTERN.search(item.strip()) - partition_tag = partition_match.group( - 1).lower() if partition_match else None - - if partition_tag: - partition_set.add(partition_tag) + for pattern in (_PARTITION_ITEM_PATTERN, _IMAGE_PARTITION_PATTERN): + partition_match = pattern.search(item.strip()) + if partition_match: + partition = partition_match.group(1).lower() + # These directories in target-files are not actual partitions. + if partition not in ('meta', 'images'): + partition_set.add(partition) return partition_set # Partitions that are grabbed from the framework partial build by default. _FRAMEWORK_PARTITIONS = { - 'system', 'product', 'system_ext', 'system_other', 'root', 'system_dlkm' -} -# Partitions that are grabbed from the vendor partial build by default. -_VENDOR_PARTITIONS = { - 'vendor', 'odm', 'oem', 'boot', 'vendor_boot', 'recovery', - 'prebuilt_images', 'radio', 'data', 'vendor_dlkm', 'odm_dlkm' + 'system', 'product', 'system_ext', 'system_other', 'root', 'system_dlkm', + 'vbmeta_system' } def InferItemList(input_namelist, framework): - item_list = [] + item_set = set() - # Some META items are grabbed from partial builds directly. + # Some META items are always grabbed from partial builds directly. # Others are combined in merge_meta.py. if framework: - item_list.extend([ + item_set.update([ 'META/liblz4.so', 'META/postinstall_config.txt', 'META/update_engine_config.txt', 'META/zucchini_config.txt', ]) else: # vendor - item_list.extend([ + item_set.update([ 'META/kernel_configs.txt', 'META/kernel_version.txt', 'META/otakeys.txt', + 'META/pack_radioimages.txt', 'META/releasetools.py', - 'OTA/android-info.txt', ]) # Grab a set of items for the expected partitions in the partial build. - for partition in (_FRAMEWORK_PARTITIONS if framework else _VENDOR_PARTITIONS): - for namelist in input_namelist: - if namelist.startswith('%s/' % partition.upper()): - fs_config_prefix = '' if partition == 'system' else '%s_' % partition - item_list.extend([ - '%s/*' % partition.upper(), - 'IMAGES/%s.img' % partition, - 'IMAGES/%s.map' % partition, - 'META/%sfilesystem_config.txt' % fs_config_prefix, - ]) - break - - return sorted(item_list) + seen_partitions = [] + for namelist in input_namelist: + if namelist.endswith('/'): + continue + + partition = namelist.split('/')[0].lower() + + # META items are grabbed above, or merged later. + if partition == 'meta': + continue + + if partition == 'images': + image_partition, extension = os.path.splitext(os.path.basename(namelist)) + if image_partition == 'vbmeta': + # Always regenerate vbmeta.img since it depends on hash information + # from both builds. + continue + if extension in ('.img', '.map'): + # Include image files in IMAGES/* if the partition comes from + # the expected set. + if (framework and image_partition in _FRAMEWORK_PARTITIONS) or ( + not framework and image_partition not in _FRAMEWORK_PARTITIONS): + item_set.add(namelist) + elif not framework: + # Include all miscellaneous non-image files in IMAGES/* from + # the vendor build. + item_set.add(namelist) + continue + + # Skip already-visited partitions. + if partition in seen_partitions: + continue + seen_partitions.append(partition) + + if (framework and partition in _FRAMEWORK_PARTITIONS) or ( + not framework and partition not in _FRAMEWORK_PARTITIONS): + fs_config_prefix = '' if partition == 'system' else '%s_' % partition + item_set.update([ + '%s/*' % partition.upper(), + 'META/%sfilesystem_config.txt' % fs_config_prefix, + ]) + + return sorted(item_set) def InferFrameworkMiscInfoKeys(input_namelist): @@ -223,8 +247,8 @@ def InferFrameworkMiscInfoKeys(input_namelist): ] for partition in _FRAMEWORK_PARTITIONS: - for namelist in input_namelist: - if namelist.startswith('%s/' % partition.upper()): + for partition_dir in ('%s/' % partition.upper(), 'SYSTEM/%s/' % partition): + if partition_dir in input_namelist: fs_type_prefix = '' if partition == 'system' else '%s_' % partition keys.extend([ 'avb_%s_hashtree_enable' % partition, diff --git a/tools/releasetools/merge/test_merge_utils.py b/tools/releasetools/merge/test_merge_utils.py index 194905023c..eceb734d21 100644 --- a/tools/releasetools/merge/test_merge_utils.py +++ b/tools/releasetools/merge/test_merge_utils.py @@ -108,20 +108,27 @@ class MergeUtilsTest(test_utils.ReleaseToolsTestCase): def test_ItemListToPartitionSet(self): item_list = [ + 'IMAGES/system_ext.img', 'META/apexkeys.txt', 'META/apkcerts.txt', 'META/filesystem_config.txt', 'PRODUCT/*', 'SYSTEM/*', - 'SYSTEM_EXT/*', + 'SYSTEM/system_ext/*', ] partition_set = merge_utils.ItemListToPartitionSet(item_list) self.assertEqual(set(['product', 'system', 'system_ext']), partition_set) def test_InferItemList_Framework(self): zip_namelist = [ + 'IMAGES/product.img', + 'IMAGES/product.map', + 'IMAGES/system.img', + 'IMAGES/system.map', 'SYSTEM/my_system_file', 'PRODUCT/my_product_file', + # Device does not use a separate system_ext partition. + 'SYSTEM/system_ext/system_ext_file', ] item_list = merge_utils.InferItemList(zip_namelist, framework=True) @@ -147,37 +154,55 @@ class MergeUtilsTest(test_utils.ReleaseToolsTestCase): zip_namelist = [ 'VENDOR/my_vendor_file', 'ODM/my_odm_file', + 'IMAGES/odm.img', + 'IMAGES/odm.map', + 'IMAGES/vendor.img', + 'IMAGES/vendor.map', + 'IMAGES/my_custom_image.img', + 'IMAGES/my_custom_file.txt', + 'IMAGES/vbmeta.img', + 'CUSTOM_PARTITION/my_custom_file', + # Leftover framework pieces that shouldn't be grabbed. + 'IMAGES/system.img', + 'SYSTEM/system_file', ] item_list = merge_utils.InferItemList(zip_namelist, framework=False) expected_vendor_item_list = [ + 'CUSTOM_PARTITION/*', + 'IMAGES/my_custom_file.txt', + 'IMAGES/my_custom_image.img', 'IMAGES/odm.img', 'IMAGES/odm.map', 'IMAGES/vendor.img', 'IMAGES/vendor.map', + 'META/custom_partition_filesystem_config.txt', 'META/kernel_configs.txt', 'META/kernel_version.txt', 'META/odm_filesystem_config.txt', 'META/otakeys.txt', + 'META/pack_radioimages.txt', 'META/releasetools.py', 'META/vendor_filesystem_config.txt', 'ODM/*', - 'OTA/android-info.txt', 'VENDOR/*', ] self.assertEqual(item_list, expected_vendor_item_list) def test_InferFrameworkMiscInfoKeys(self): zip_namelist = [ - 'SYSTEM/my_system_file', - 'SYSTEM_EXT/my_system_ext_file', + 'PRODUCT/', + 'SYSTEM/', + 'SYSTEM/system_ext/', ] keys = merge_utils.InferFrameworkMiscInfoKeys(zip_namelist) expected_keys = [ 'ab_update', + 'avb_product_add_hashtree_footer_args', + 'avb_product_hashtree_enable', 'avb_system_add_hashtree_footer_args', 'avb_system_ext_add_hashtree_footer_args', 'avb_system_ext_hashtree_enable', @@ -186,10 +211,13 @@ class MergeUtilsTest(test_utils.ReleaseToolsTestCase): 'avb_vbmeta_system_algorithm', 'avb_vbmeta_system_key_path', 'avb_vbmeta_system_rollback_index_location', + 'building_product_image', 'building_system_ext_image', 'building_system_image', 'default_system_dev_certificate', 'fs_type', + 'product_disable_sparse', + 'product_fs_type', 'system_disable_sparse', 'system_ext_disable_sparse', 'system_ext_fs_type', diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 522d489195..66e850b482 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -1208,6 +1208,8 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): metadata.postcondition.partition_state) if not ota_utils.IsZucchiniCompatible(source_file, target_file): + logger.warning( + "Builds doesn't support zucchini, or source/target don't have compatible zucchini versions. Disabling zucchini.") OPTIONS.enable_zucchini = False additional_args += ["--enable_zucchini", diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py index 5d403dc9f4..ef1dca232c 100644 --- a/tools/releasetools/ota_utils.py +++ b/tools/releasetools/ota_utils.py @@ -22,7 +22,8 @@ import zipfile import ota_metadata_pb2 from common import (ZipDelete, ZipClose, OPTIONS, MakeTempFile, ZipWriteStr, BuildInfo, LoadDictionaryFromFile, - SignFile, PARTITIONS_WITH_BUILD_PROP, PartitionBuildProps) + SignFile, PARTITIONS_WITH_BUILD_PROP, PartitionBuildProps, + GetRamdiskFormat) logger = logging.getLogger(__name__) @@ -371,15 +372,18 @@ def ComputeRuntimeBuildInfos(default_build_info, boot_variable_values): for partition in PARTITIONS_WITH_BUILD_PROP: partition_prop_key = "{}.build.prop".format(partition) input_file = info_dict[partition_prop_key].input_file + ramdisk = GetRamdiskFormat(info_dict) if isinstance(input_file, zipfile.ZipFile): with zipfile.ZipFile(input_file.filename, allowZip64=True) as input_zip: info_dict[partition_prop_key] = \ PartitionBuildProps.FromInputFile(input_zip, partition, - placeholder_values) + placeholder_values, + ramdisk) else: info_dict[partition_prop_key] = \ PartitionBuildProps.FromInputFile(input_file, partition, - placeholder_values) + placeholder_values, + ramdisk) info_dict["build.prop"] = info_dict["system.build.prop"] build_info_set.add(BuildInfo(info_dict, default_build_info.oem_dicts)) @@ -693,6 +697,7 @@ def IsZucchiniCompatible(source_file: str, target_file: str): if os.path.exists(entry_path): with open(entry_path, "r") as fp: return fp.read() - else: - return "" - return ReadEntry(source_file, _ZUCCHINI_CONFIG_ENTRY_NAME) == ReadEntry(target_file, _ZUCCHINI_CONFIG_ENTRY_NAME) + return False + sourceEntry = ReadEntry(source_file, _ZUCCHINI_CONFIG_ENTRY_NAME) + targetEntry = ReadEntry(target_file, _ZUCCHINI_CONFIG_ENTRY_NAME) + return sourceEntry and targetEntry and sourceEntry == targetEntry |