Merge "Add support for *_CPU_VARIANT_RUNTIME flags"
diff --git a/core/Makefile b/core/Makefile
index cfa042c..3cc9831 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -704,8 +704,10 @@
ifneq (,$(TARGET_BUILD_APPS))
$(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt)
+ $(call dist-for-goals, apps_only, $(SOONG_APEX_KEYS_FILE):apexkeys.txt)
endif
+
# -----------------------------------------------------------------
# build system stats
BUILD_SYSTEM_STATS := $(PRODUCT_OUT)/build_system_stats.txt
@@ -3429,6 +3431,8 @@
$(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \
$(HOST_OUT_EXECUTABLES)/delta_generator \
$(HOST_OUT_EXECUTABLES)/care_map_generator \
+ $(HOST_OUT_EXECUTABLES)/fc_sort \
+ $(HOST_OUT_EXECUTABLES)/sefcontext_compile \
$(LPMAKE) \
$(AVBTOOL) \
$(BLK_ALLOC_TO_BASE_FS) \
@@ -3664,6 +3668,7 @@
$(LPMAKE) \
$(SELINUX_FC) \
$(APKCERTS_FILE) \
+ $(SOONG_APEX_KEYS_FILE) \
$(SOONG_ZIP) \
$(HOST_OUT_EXECUTABLES)/fs_config \
$(HOST_OUT_EXECUTABLES)/imgdiff \
@@ -3797,6 +3802,7 @@
@# build them.
$(hide) mkdir -p $(zip_root)/META
$(hide) cp $(APKCERTS_FILE) $(zip_root)/META/apkcerts.txt
+ $(hide) cp $(SOONG_APEX_KEYS_FILE) $(zip_root)/META/apexkeys.txt
ifneq ($(tool_extension),)
$(hide) cp $(PRIVATE_TOOL_EXTENSION) $(zip_root)/META/
endif
@@ -4079,6 +4085,8 @@
INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
+INTERNAL_OTA_METADATA := $(PRODUCT_OUT)/ota_metadata
+
$(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
ifeq ($(AB_OTA_UPDATER),true)
@@ -4087,10 +4095,12 @@
$(INTERNAL_OTA_PACKAGE_TARGET): $(BROTLI)
endif
+$(INTERNAL_OTA_PACKAGE_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_OTA_METADATA)
+
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \
build/make/tools/releasetools/ota_from_target_files
@echo "Package OTA: $@"
- $(call build-ota-package-target,$@,-k $(KEY_CERT_PAIR))
+ $(call build-ota-package-target,$@,-k $(KEY_CERT_PAIR) --output_metadata_path $(INTERNAL_OTA_METADATA))
.PHONY: otapackage
otapackage: $(INTERNAL_OTA_PACKAGE_TARGET)
@@ -4601,9 +4611,3 @@
ifneq ($(sdk_repo_goal),)
include $(TOPDIR)development/build/tools/sdk_repo.mk
endif
-
-#------------------------------------------------------------------
-# Find lsdump paths
-FIND_LSDUMPS_FILE := $(PRODUCT_OUT)/lsdump_paths.txt
-$(FIND_LSDUMPS_FILE) : $(LSDUMP_PATHS)
- $(hide) rm -rf $@ && echo "$^" | sed -e 's/ /\n/g' > $@
diff --git a/core/android_vts_host_config.mk b/core/android_vts_host_config.mk
new file mode 100644
index 0000000..38ba19d
--- /dev/null
+++ b/core/android_vts_host_config.mk
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2016 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.
+#
+
+LOCAL_MODULE_CLASS := FAKE
+LOCAL_IS_HOST_MODULE := true
+LOCAL_COMPATIBILITY_SUITE := vts
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE):
+ @echo "VTS host-driven test target: $(PRIVATE_MODULE)"
+ $(hide) touch $@
+
diff --git a/core/binary.mk b/core/binary.mk
index ccf5580..8e1281a 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -657,7 +657,7 @@
proto_sources_fullpath := $(addprefix $(LOCAL_PATH)/, $(proto_sources))
my_rename_cpp_ext :=
-ifneq (,$(filter nanopb-c nanopb-c-enable_malloc, $(LOCAL_PROTOC_OPTIMIZE_TYPE)))
+ifneq (,$(filter nanopb-c nanopb-c-enable_malloc nanopb-c-16bit nanopb-c-enable_malloc-16bit nanopb-c-32bit nanopb-c-enable_malloc-32bit, $(LOCAL_PROTOC_OPTIMIZE_TYPE)))
my_proto_source_suffix := .c
my_proto_c_includes := external/nanopb-c
my_protoc_flags := --nanopb_out=$(proto_gen_dir) \
@@ -712,6 +712,14 @@
my_static_libraries += libprotobuf-c-nano-enable_malloc
else ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nanopb-c)
my_static_libraries += libprotobuf-c-nano
+else ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nanopb-c-enable_malloc-16bit)
+ my_static_libraries += libprotobuf-c-nano-enable_malloc-16bit
+else ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nanopb-c-16bit)
+ my_static_libraries += libprotobuf-c-nano-16bit
+else ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nanopb-c-enable_malloc-32bit)
+ my_static_libraries += libprotobuf-c-nano-enable_malloc-32bit
+else ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nanopb-c-32bit)
+ my_static_libraries += libprotobuf-c-nano-32bit
else ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),full)
ifdef LOCAL_SDK_VERSION
my_static_libraries += libprotobuf-cpp-full-ndk
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index c20dbef..1e3f6ae 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -222,7 +222,7 @@
LOCAL_PROGUARD_FLAGS:=
LOCAL_PROPRIETARY_MODULE:=
LOCAL_PROTOC_FLAGS:=
-# lite(default),micro,nano,stream,full,nanopb-c,nanopb-c-enable_malloc
+# lite(default),micro,nano,stream,full,nanopb-c,nanopb-c-enable_malloc,nanopb-c-16bit,nanopb-c-enable_malloc-16bit,nanopb-c-32bit,nanopb-c-enable_malloc-32bit
LOCAL_PROTOC_OPTIMIZE_TYPE:=
LOCAL_PROTO_JAVA_OUTPUT_PARAMS:=
LOCAL_R8_FLAG_FILES:=
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 7471c47..5a32ee9 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -13,36 +13,21 @@
install-on-system-other = $(filter-out $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1)))))
endif
-# Special rules for building stripped boot jars that override java_library.mk rules
-
-# $(1): boot jar module name
-define _dexpreopt-boot-jar-remove-classes.dex
-_dbj_jar_no_dex := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$(1)_nodex.jar
-_dbj_src_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(1),,COMMON)/javalib.jar
-
-$(call dexpreopt-copy-jar,$$(_dbj_src_jar),$$(_dbj_jar_no_dex),$(filter-out nostripping,$(DEX_PREOPT_DEFAULT)))
-
-_dbj_jar_no_dex :=
-_dbj_src_jar :=
-endef
-
-$(foreach b,$(DEXPREOPT_BOOT_JARS_MODULES),$(eval $(call _dexpreopt-boot-jar-remove-classes.dex,$(b))))
-
include $(BUILD_SYSTEM)/dex_preopt_libart.mk
-ifeq ($(PRODUCT_DIST_BOOT_AND_SYSTEM_JARS),true)
boot_profile_jars_zip := $(PRODUCT_OUT)/boot_profile_jars.zip
-all_boot_jars := \
- $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES) \
- $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar)
+bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)
+system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar)
-$(boot_profile_jars_zip): PRIVATE_JARS := $(all_boot_jars)
-$(boot_profile_jars_zip): $(all_boot_jars) $(SOONG_ZIP)
- echo "Create boot profiles package: $@"
+$(boot_profile_jars_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars)
+$(boot_profile_jars_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars)
+$(boot_profile_jars_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP)
+ @echo "Create boot profiles package: $@"
rm -f $@
- $(SOONG_ZIP) -o $@ -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_JARS))
+ $(SOONG_ZIP) -o $@ \
+ -C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \
+ -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS))
-droidcore: $(boot_profile_jars_zip)
-
+ifeq ($(PRODUCT_DIST_BOOT_AND_SYSTEM_JARS),true)
$(call dist-for-goals, droidcore, $(boot_profile_jars_zip))
endif
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index e3b720b..72d3345 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -47,9 +47,9 @@
# Default to debug version to help find bugs.
# Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
ifeq ($(USE_DEX2OAT_DEBUG),false)
-DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oat$(HOST_EXECUTABLE_SUFFIX)
+DEX2OAT := $(SOONG_HOST_OUT_EXECUTABLES)/dex2oat$(HOST_EXECUTABLE_SUFFIX)
else
-DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
+DEX2OAT := $(SOONG_HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
endif
DEX2OAT_DEPENDENCY += $(DEX2OAT)
@@ -62,25 +62,6 @@
DIRTY_IMAGE_OBJECTS := $(call word-colon,1,$(firstword \
$(filter %system/etc/dirty-image-objects,$(PRODUCT_COPY_FILES))))
-# If we use a boot image profile.
-my_use_profile_for_boot_image := $(PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE)
-ifeq (,$(my_use_profile_for_boot_image))
- # If not set, set the default to true if we are not a PDK build. PDK builds
- # can't build the profile since they don't have frameworks/base.
- ifneq (true,$(TARGET_BUILD_PDK))
- my_use_profile_for_boot_image := true
- endif
-endif
-
-ifeq (true,$(my_use_profile_for_boot_image))
- boot_image_profiles := $(PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION)
-
- ifeq (,$(boot_image_profiles))
- # If not set, use the default.
- boot_image_profiles := frameworks/base/config/boot-image-profile.txt
- endif
-endif
-
define get-product-default-property
$(strip \
$(eval _prop := $(patsubst $(1)=%,%,$(filter $(1)=%,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))))\
@@ -107,6 +88,7 @@
$(call json_start)
$(call add_json_bool, DefaultNoStripping, $(filter nostripping,$(DEX_PREOPT_DEFAULT)))
+ $(call add_json_bool, DisablePreopt, $(call invert_bool,$(filter true,$(WITH_DEXPREOPT))))
$(call add_json_list, DisablePreoptModules, $(DEXPREOPT_DISABLED_MODULES))
$(call add_json_bool, OnlyPreoptBootImageAndSystemServer, $(filter true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)))
$(call add_json_bool, DontUncompressPrivAppsDex, $(filter true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS)))
@@ -114,8 +96,9 @@
$(call add_json_bool, HasSystemOther, $(BOARD_USES_SYSTEM_OTHER_ODEX))
$(call add_json_list, PatternsOnSystemOther, $(SYSTEM_OTHER_ODEX_FILTER))
$(call add_json_bool, DisableGenerateProfile, $(filter false,$(WITH_DEX_PREOPT_GENERATE_PROFILE)))
+ $(call add_json_str, ProfileDir, $(PRODUCT_DEX_PREOPT_PROFILE_DIR))
$(call add_json_list, BootJars, $(PRODUCT_BOOT_JARS))
- $(call add_json_list, TargetCoreJars, $(TARGET_CORE_JARS))
+ $(call add_json_list, RuntimeApexJars, $(RUNTIME_APEX_JARS))
$(call add_json_list, ProductUpdatableBootModules, $(PRODUCT_UPDATABLE_BOOT_MODULES))
$(call add_json_list, ProductUpdatableBootLocations, $(PRODUCT_UPDATABLE_BOOT_LOCATIONS))
$(call add_json_list, SystemServerJars, $(PRODUCT_SYSTEM_SERVER_JARS))
@@ -155,15 +138,16 @@
$(call add_json_str, DirtyImageObjects, $(DIRTY_IMAGE_OBJECTS))
$(call add_json_str, PreloadedClasses, $(PRELOADED_CLASSES))
- $(call add_json_list, BootImageProfiles, $(boot_image_profiles))
+ $(call add_json_list, BootImageProfiles, $(PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION))
+ $(call add_json_bool, UseProfileForBootImage, $(call invert_bool,$(filter false,$(PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE))))
$(call add_json_str, BootFlags, $(PRODUCT_DEX_PREOPT_BOOT_FLAGS))
$(call add_json_str, Dex2oatImageXmx, $(DEX2OAT_IMAGE_XMX))
$(call add_json_str, Dex2oatImageXms, $(DEX2OAT_IMAGE_XMS))
$(call add_json_map, Tools)
- $(call add_json_str, Profman, $(PROFMAN))
+ $(call add_json_str, Profman, $(SOONG_HOST_OUT_EXECUTABLES)/profman)
$(call add_json_str, Dex2oat, $(DEX2OAT))
- $(call add_json_str, Aapt, $(AAPT))
+ $(call add_json_str, Aapt, $(SOONG_HOST_OUT_EXECUTABLES)/aapt)
$(call add_json_str, SoongZip, $(SOONG_ZIP))
$(call add_json_str, Zip2zip, $(ZIP2ZIP))
$(call add_json_str, VerifyUsesLibraries, $(BUILD_SYSTEM)/verify_uses_libraries.sh)
@@ -190,9 +174,9 @@
@#empty
DEXPREOPT_GEN_DEPS := \
- $(PROFMAN) \
+ $(SOONG_HOST_OUT_EXECUTABLES)/profman \
$(DEX2OAT) \
- $(AAPT) \
+ $(SOONG_HOST_OUT_EXECUTABLES)/aapt \
$(SOONG_ZIP) \
$(ZIP2ZIP) \
$(BUILD_SYSTEM)/verify_uses_libraries.sh \
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 0beead9..bda871c 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -190,10 +190,12 @@
$(call json_start)
+ # DexPath, StripInputPath, and StripOutputPath are not set, they will
+ # be filled in by dexpreopt_gen.
+
$(call add_json_str, Name, $(LOCAL_MODULE))
$(call add_json_str, DexLocation, $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)))
$(call add_json_str, BuildPath, $(LOCAL_BUILT_MODULE))
- $(call add_json_str, DexPath, $$1)
$(call add_json_str, ExtrasOutputPath, $$2)
$(call add_json_bool, Privileged, $(filter true,$(LOCAL_PRIVILEGED_MODULE)))
$(call add_json_bool, UncompressedDex, $(filter true,$(LOCAL_UNCOMPRESS_DEX)))
@@ -218,8 +220,6 @@
$(call add_json_bool, PresignedPrebuilt, $(filter PRESIGNED,$(LOCAL_CERTIFICATE)))
$(call add_json_bool, NoStripping, $(filter nostripping,$(LOCAL_DEX_PREOPT)))
- $(call add_json_str, StripInputPath, $$1)
- $(call add_json_str, StripOutputPath, $$2)
$(call json_end)
@@ -244,7 +244,8 @@
$(my_dexpreopt_script): $(my_dexpreopt_config) $(PRODUCT_OUT)/dexpreopt.config
@echo "$(PRIVATE_MODULE) dexpreopt gen"
$(DEXPREOPT_GEN) -global $(PRIVATE_GLOBAL_CONFIG) -module $(PRIVATE_MODULE_CONFIG) \
- -dexpreopt_script $@ -strip_script $(PRIVATE_STRIP_SCRIPT)
+ -dexpreopt_script $@ -strip_script $(PRIVATE_STRIP_SCRIPT) \
+ -out_dir $(OUT_DIR)
my_dexpreopt_deps := $(my_dex_jar)
my_dexpreopt_deps += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE))
diff --git a/core/envsetup.mk b/core/envsetup.mk
index e62636e..cc427ca 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -206,7 +206,10 @@
#################################################################
# Set up minimal BOOTCLASSPATH list of jars to build/execute
# java code with dalvikvm/art.
-TARGET_CORE_JARS := core-oj core-libart conscrypt okhttp bouncycastle apache-xml
+# Jars present in the runtime apex. These should match exactly the list of
+# Java libraries in the runtime apex build rule.
+RUNTIME_APEX_JARS := core-oj core-libart okhttp bouncycastle apache-xml
+TARGET_CORE_JARS := $(RUNTIME_APEX_JARS) conscrypt
ifeq ($(EMMA_INSTRUMENT),true)
ifneq ($(EMMA_INSTRUMENT_STATIC),true)
# For instrumented build, if Jacoco is not being included statically
diff --git a/core/main.mk b/core/main.mk
index 01646bf..b63fd61 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1439,6 +1439,7 @@
$(call dist-for-goals, droidcore, \
$(INTERNAL_UPDATE_PACKAGE_TARGET) \
$(INTERNAL_OTA_PACKAGE_TARGET) \
+ $(INTERNAL_OTA_METADATA) \
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) \
$(BUILT_OTATOOLS_PACKAGE) \
$(SYMBOLS_ZIP) \
@@ -1566,8 +1567,15 @@
.PHONY: findbugs
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
+LSDUMP_PATHS_FILE := $(PRODUCT_OUT)/lsdump_paths.txt
+
.PHONY: findlsdumps
-findlsdumps: $(FIND_LSDUMPS_FILE)
+findlsdumps: $(LSDUMP_PATHS_FILE) $(LSDUMP_PATHS)
+
+$(LSDUMP_PATHS_FILE): PRIVATE_LSDUMP_PATHS := $(LSDUMP_PATHS)
+$(LSDUMP_PATHS_FILE):
+ @echo "Generate $@"
+ @rm -rf $@ && echo "$(PRIVATE_LSDUMP_PATHS)" | sed -e 's/ /\n/g' > $@
.PHONY: check-elf-files
check-elf-files:
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 1fb0c29..3c82e88 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -114,11 +114,6 @@
$(call add_json_list, ModulesLoadedByPrivilegedModules, $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))
$(call add_json_list, BootJars, $(PRODUCT_BOOT_JARS))
-$(call add_json_list, PreoptBootJars, $(DEXPREOPT_BOOT_JARS_MODULES))
-
-$(call add_json_bool, DisableDexPreopt, $(call invert_bool,$(filter true,$(WITH_DEXPREOPT))))
-$(call add_json_list, DisableDexPreoptModules, $(DEXPREOPT_DISABLED_MODULES))
-$(call add_json_str, DexPreoptProfileDir, $(PRODUCT_DEX_PREOPT_PROFILE_DIR))
$(call add_json_bool, Product_is_iot, $(filter true,$(PRODUCT_IOT)))
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index a3cd3ac..835d9fe 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -252,7 +252,7 @@
# 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 := 2019-01-05
+ PLATFORM_SECURITY_PATCH := 2019-02-05
endif
.KATI_READONLY := PLATFORM_SECURITY_PATCH
diff --git a/envsetup.sh b/envsetup.sh
index 0953487..9e381a2 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -267,6 +267,13 @@
export ANDROID_EMULATOR_PREBUILTS
fi
+ # Append asuite prebuilts path to ANDROID_BUILD_PATHS.
+ local os_arch=$(get_build_var HOST_PREBUILT_TAG)
+ local ACLOUD_PATH="$T/prebuilts/asuite/acloud/$os_arch:"
+ local AIDEGEN_PATH="$T/prebuilts/asuite/aidegen/$os_arch:"
+ local ATEST_PATH="$T/prebuilts/asuite/atest/$os_arch:"
+ export ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS$ACLOUD_PATH$AIDEGEN_PATH$ATEST_PATH
+
export PATH=$ANDROID_BUILD_PATHS$PATH
# out with the duplicate old
@@ -355,7 +362,7 @@
local completion_files=(
system/core/adb/adb.bash
system/core/fastboot/fastboot.bash
- tools/tradefederation/core/atest/atest_completion.sh
+ tools/asuite/asuite.sh
)
# Completion can be disabled selectively to allow users to use non-standard completion.
# e.g.
@@ -1689,23 +1696,6 @@
"$ANDROID_PRODUCT_OUT/provision-device" "$@"
}
-function atest()
-{
- # Let's use the built version over the prebuilt, then source code.
- local os_arch=$(get_build_var HOST_PREBUILT_TAG)
- local built_atest=${ANDROID_HOST_OUT}/bin/atest
- local prebuilt_atest="$(gettop)"/prebuilts/asuite/atest/$os_arch/atest
- if [[ -x $built_atest ]]; then
- $built_atest "$@"
- elif [[ -x $prebuilt_atest ]]; then
- $prebuilt_atest "$@"
- else
- # TODO: once prebuilt atest released, remove the source code section
- # and change the location of atest_completion.sh in addcompletions().
- "$(gettop)"/tools/tradefederation/core/atest/atest.py "$@"
- fi
-}
-
# Zsh needs bashcompinit called to support bash-style completion.
function enable_zsh_completion() {
# Don't override user's options if bash-style completion is already enabled.
@@ -1730,40 +1720,6 @@
esac
}
-function acloud()
-{
- # Let's use the built version over the prebuilt.
- local built_acloud=${ANDROID_HOST_OUT}/bin/acloud
- if [ -f $built_acloud ]; then
- $built_acloud "$@"
- return $?
- fi
-
- local host_os_arch=$(get_build_var HOST_PREBUILT_TAG)
- case $host_os_arch in
- linux-x86) "$(gettop)"/prebuilts/asuite/acloud/linux-x86/acloud "$@"
- ;;
- darwin-x86) "$(gettop)"/prebuilts/asuite/acloud/darwin-x86/acloud "$@"
- ;;
- *)
- echo "acloud is not supported on your host arch: $host_os_arch"
- ;;
- esac
-}
-
-function aidegen()
-{
- # Always use the prebuilt version.
- local host_os_arch=$(get_build_var HOST_PREBUILT_TAG)
- case $host_os_arch in
- linux-x86) "$(gettop)"/prebuilts/asuite/aidegen/linux-x86/aidegen "$@"
- ;;
- *)
- echo "aidegen is not supported on your host arch: $host_os_arch"
- ;;
- esac
-}
-
# Execute the contents of any vendorsetup.sh files we can find.
# Unless we find an allowed-vendorsetup_sh-files file, in which case we'll only
# load those.
diff --git a/target/board/BoardConfigGsiCommon.mk b/target/board/BoardConfigGsiCommon.mk
index 88bc7da..68d29c8 100644
--- a/target/board/BoardConfigGsiCommon.mk
+++ b/target/board/BoardConfigGsiCommon.mk
@@ -34,11 +34,14 @@
# Android Verified Boot (AVB):
# Set AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (--flags 2) in
-# vbmeta.img to disable AVB verification.
+# vbmeta.img to disable AVB verification. Also set the rollback index
+# to zero, to prevent the device bootloader from updating the last seen
+# rollback index in the tamper-evident storage.
#
# To disable AVB for GSI, use the vbmeta.img and the GSI together.
# To enable AVB for GSI, include the GSI public key into the device-specific
# vbmeta.img.
+BOARD_AVB_ROLLBACK_INDEX := 0
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 2
# Enable chain partition for system.
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index fe1954e..f8ff22f 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -114,6 +114,7 @@
libandroidfw \
libandroid_runtime \
libandroid_servers \
+ libartpalette-system \
libashmemd_client \
libaudioeffect_jni \
libaudioflinger \
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index b02363c..0a9933b 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -35,7 +35,6 @@
from __future__ import print_function
-import argparse
import fnmatch
import logging
import os
@@ -48,6 +47,10 @@
logger = logging.getLogger(__name__)
OPTIONS = common.OPTIONS
OPTIONS.verbose = True
+OPTIONS.system_target_files = None
+OPTIONS.other_target_files = None
+OPTIONS.output_target_files = None
+OPTIONS.keep_tmp = False
# system_extract_as_is_item_list is a list of items to extract from the partial
# system target files package as is, meaning these items will land in the
@@ -561,8 +564,7 @@
f.write(other_content)
command = [
- # TODO(124468071): Use soong_zip from otatools.zip
- 'prebuilts/build-tools/linux-x86/bin/soong_zip',
+ 'soong_zip',
'-d',
'-o', output_zip,
'-C', output_target_files_temp_dir,
@@ -643,36 +645,41 @@
common.InitLogging()
- parser = argparse.ArgumentParser()
+ def option_handler(o, a):
+ if o == '--system-target-files':
+ OPTIONS.system_target_files = a
+ elif o == '--other-target-files':
+ OPTIONS.other_target_files = a
+ elif o == '--output-target-files':
+ OPTIONS.output_target_files = a
+ elif o == '--keep_tmp':
+ OPTIONS.keep_tmp = True
+ else:
+ return False
+ return True
- parser.add_argument(
- '--system-target-files',
- required=True,
- help='The input target files package containing system bits.')
+ args = common.ParseOptions(
+ sys.argv[1:], __doc__,
+ extra_long_opts=[
+ 'system-target-files=',
+ 'other-target-files=',
+ 'output-target-files=',
+ "keep_tmp",
+ ],
+ extra_option_handler=option_handler)
- parser.add_argument(
- '--other-target-files',
- required=True,
- help='The input target files package containing other bits.')
-
- parser.add_argument(
- '--output-target-files',
- required=True,
- help='The output merged target files package.')
-
- parser.add_argument(
- '--keep-tmp',
- required=False,
- action='store_true',
- help='Keep the temporary directories after execution.')
-
- args = parser.parse_args()
+ if (len(args) != 0 or
+ OPTIONS.system_target_files is None or
+ OPTIONS.other_target_files is None or
+ OPTIONS.output_target_files is None):
+ common.Usage(__doc__)
+ return 1
return merge_target_files_with_temp_dir(
- system_target_files=args.system_target_files,
- other_target_files=args.other_target_files,
- output_target_files=args.output_target_files,
- keep_tmp=args.keep_tmp)
+ system_target_files=OPTIONS.system_target_files,
+ other_target_files=OPTIONS.other_target_files,
+ output_target_files=OPTIONS.output_target_files,
+ keep_tmp=OPTIONS.keep_tmp)
if __name__ == '__main__':
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 4336cb3..fa9e2e9 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -71,6 +71,13 @@
partitions but the target build does. For A/B, when this flag is set,
--skip_postinstall is implied.
+ --skip_compatibility_check
+ Skip adding the compatibility package to the generated OTA package.
+
+ --output_metadata_path
+ Write a copy of the metadata to a separate file. Therefore, users can
+ read the post build fingerprint without extracting the OTA package.
+
Non-A/B OTA specific options
-b (--binary) <file>
@@ -221,6 +228,8 @@
OPTIONS.key_passwords = []
OPTIONS.skip_postinstall = False
OPTIONS.retrofit_dynamic_partitions = False
+OPTIONS.skip_compatibility_check = False
+OPTIONS.output_metadata_path = None
METADATA_NAME = 'META-INF/com/android/metadata'
@@ -750,6 +759,11 @@
if not HasTrebleEnabled(target_zip, target_info):
return
+ # Skip adding the compatibility package as a workaround for b/114240221. The
+ # compatibility will always fail on devices without qualified kernels.
+ if OPTIONS.skip_compatibility_check:
+ return
+
# Full OTA carries the info for system/vendor both.
if source_info is None:
AddCompatibilityArchive(True, True)
@@ -969,10 +983,22 @@
FinalizeMetadata(metadata, staging_file, output_file, needed_property_files)
-def WriteMetadata(metadata, output_zip):
+def WriteMetadata(metadata, output):
+ """Writes the metadata to the zip archive or a file.
+
+ Args:
+ metadata: The metadata dict for the package.
+ output: A ZipFile object or a string of the output file path.
+ """
+
value = "".join(["%s=%s\n" % kv for kv in sorted(metadata.iteritems())])
- common.ZipWriteStr(output_zip, METADATA_NAME, value,
- compress_type=zipfile.ZIP_STORED)
+ if isinstance(output, zipfile.ZipFile):
+ common.ZipWriteStr(output, METADATA_NAME, value,
+ compress_type=zipfile.ZIP_STORED)
+ return
+
+ with open(output, 'w') as f:
+ f.write(value)
def HandleDowngradeMetadata(metadata, target_info, source_info):
@@ -1416,6 +1442,11 @@
for property_files in needed_property_files:
property_files.Verify(output_zip, metadata[property_files.name].strip())
+ # If requested, dump the metadata to a separate file.
+ output_metadata_path = OPTIONS.output_metadata_path
+ if output_metadata_path:
+ WriteMetadata(metadata, output_metadata_path)
+
def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_file):
target_info = BuildInfo(OPTIONS.target_info_dict, OPTIONS.oem_dicts)
@@ -2032,6 +2063,10 @@
OPTIONS.skip_postinstall = True
elif o == "--retrofit_dynamic_partitions":
OPTIONS.retrofit_dynamic_partitions = True
+ elif o == "--skip_compatibility_check":
+ OPTIONS.skip_compatibility_check = True
+ elif o == "--output_metadata_path":
+ OPTIONS.output_metadata_path = a
else:
return False
return True
@@ -2063,6 +2098,8 @@
"extracted_input_target_files=",
"skip_postinstall",
"retrofit_dynamic_partitions",
+ "skip_compatibility_check",
+ "output_metadata_path=",
], extra_option_handler=option_handler)
if len(args) != 2:
diff --git a/tools/releasetools/test_validate_target_files.py b/tools/releasetools/test_validate_target_files.py
index a6a8876..5f619ec 100644
--- a/tools/releasetools/test_validate_target_files.py
+++ b/tools/releasetools/test_validate_target_files.py
@@ -19,11 +19,13 @@
import os
import os.path
import shutil
+import zipfile
import common
import test_utils
-import verity_utils
-from validate_target_files import ValidateVerifiedBootImages
+from rangelib import RangeSet
+from validate_target_files import (ValidateVerifiedBootImages,
+ ValidateFileConsistency)
from verity_utils import CreateVerityImageBuilder
@@ -107,7 +109,8 @@
AssertionError, ValidateVerifiedBootImages, input_tmp, info_dict,
options)
- def _generate_system_image(self, output_file):
+ def _generate_system_image(self, output_file, system_root=None,
+ file_map=None):
prop_dict = {
'partition_size': str(1024 * 1024),
'verity': 'true',
@@ -120,9 +123,12 @@
image_size = verity_image_builder.CalculateMaxImageSize()
# Use an empty root directory.
- system_root = common.MakeTempDir()
+ if not system_root:
+ system_root = common.MakeTempDir()
cmd = ['mkuserimg_mke2fs', '-s', system_root, output_file, 'ext4',
'/system', str(image_size), '-j', '0']
+ if file_map:
+ cmd.extend(['-B', file_map])
proc = common.Run(cmd)
stdoutdata, _ = proc.communicate()
self.assertEqual(
@@ -155,3 +161,56 @@
'verity_key_mincrypt' : verity_key_mincrypt,
}
ValidateVerifiedBootImages(input_tmp, info_dict, options)
+
+ def test_ValidateFileConsistency_incompleteRange(self):
+ input_tmp = common.MakeTempDir()
+ os.mkdir(os.path.join(input_tmp, 'IMAGES'))
+ system_image = os.path.join(input_tmp, 'IMAGES', 'system.img')
+ system_root = os.path.join(input_tmp, "SYSTEM")
+ os.mkdir(system_root)
+
+ # Write the test file that contain multiple blocks of zeros, and these
+ # zero blocks will be omitted by kernel. And the test files will occupy one
+ # block range each in the final system image.
+ with open(os.path.join(system_root, 'a'), 'w') as f:
+ f.write("aaa")
+ f.write('\0' * 4096 * 3)
+ with open(os.path.join(system_root, 'b'), 'w') as f:
+ f.write("bbb")
+ f.write('\0' * 4096 * 3)
+
+ raw_file_map = os.path.join(input_tmp, 'IMAGES', 'raw_system.map')
+ self._generate_system_image(system_image, system_root, raw_file_map)
+
+ # Parse the generated file map and update the block ranges for each file.
+ file_map_list = {}
+ image_ranges = RangeSet()
+ with open(raw_file_map, 'r') as f:
+ for line in f.readlines():
+ info = line.split()
+ self.assertEqual(2, len(info))
+ image_ranges = image_ranges.union(RangeSet(info[1]))
+ file_map_list[info[0]] = RangeSet(info[1])
+
+ # Add one unoccupied block as the shared block for all test files.
+ mock_shared_block = RangeSet("10-20").subtract(image_ranges).first(1)
+ with open(os.path.join(input_tmp, 'IMAGES', 'system.map'), 'w') as f:
+ for key in sorted(file_map_list.keys()):
+ line = "{} {}\n".format(
+ key, file_map_list[key].union(mock_shared_block))
+ f.write(line)
+
+ # Prepare for the target zip file
+ input_file = common.MakeTempFile()
+ all_entries = ['SYSTEM/', 'SYSTEM/b', 'SYSTEM/a', 'IMAGES/',
+ 'IMAGES/system.map', 'IMAGES/system.img']
+ with zipfile.ZipFile(input_file, 'w') as input_zip:
+ for name in all_entries:
+ input_zip.write(os.path.join(input_tmp, name), arcname=name)
+
+ input_zip = zipfile.ZipFile(input_file, 'r')
+ info_dict = {'extfs_sparse_flag': '-s'}
+
+ # Expect the validation to pass and both files are skipped due to
+ # 'incomplete' block range.
+ ValidateFileConsistency(input_zip, input_tmp, info_dict)
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index eeb802b..275939c 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -84,11 +84,6 @@
# bytes past the file length, which is expected to be padded with '\0's.
ranges = image.file_map[entry]
- incomplete = ranges.extra.get('incomplete', False)
- if incomplete:
- logging.warning('Skipping %s that has incomplete block list', entry)
- continue
-
# Use the original RangeSet if applicable, which includes the shared
# blocks. And this needs to happen before checking the monotonicity flag.
if ranges.extra.get('uses_shared_blocks'):
@@ -96,6 +91,11 @@
else:
file_ranges = ranges
+ incomplete = file_ranges.extra.get('incomplete', False)
+ if incomplete:
+ logging.warning('Skipping %s that has incomplete block list', entry)
+ continue
+
# TODO(b/79951650): Handle files with non-monotonic ranges.
if not file_ranges.monotonic:
logging.warning(