Merge "Add a host simulation of the tzdata module"
diff --git a/Changes.md b/Changes.md
index be2a271..461de97 100644
--- a/Changes.md
+++ b/Changes.md
@@ -1,5 +1,23 @@
# Build System Changes for Android.mk Writers
+## PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete {#PRODUCT_STATIC_BOOT_CONTROL_HAL}
+
+`PRODUCT_STATIC_BOOT_CONTROL_HAL` was the workaround to allow sideloading with
+statically linked boot control HAL, before shared library HALs were supported
+under recovery. Android Q has added such support (HALs will be loaded in
+passthrough mode), and the workarounds are being removed. Targets should build
+and install the recovery variant of boot control HAL modules into recovery
+image, similar to the ones installed for normal boot. See the change to
+crosshatch for example of this:
+
+* [device/google/crosshatch/bootctrl/Android.bp] for `bootctrl.sdm845` building
+ rules
+* [device/google/crosshatch/device.mk] for installing `bootctrl.sdm845.recovery`
+ and `android.hardware.boot@1.0-impl.recovery` into recovery image
+
+[device/google/crosshatch/bootctrl/Android.bp]: https://android.googlesource.com/device/google/crosshatch/+/master/bootctrl/Android.bp
+[device/google/crosshatch/device.mk]: https://android.googlesource.com/device/google/crosshatch/+/master/device.mk
+
## Deprecation of `BUILD_*` module types
See [build/make/Deprecation.md](Deprecation.md) for the current status.
@@ -49,9 +67,9 @@
Modules that build for Windows (our only `HOST_CROSS` OS currently) must now be
defined in `Android.bp` files.
-## `LOCAL_MODULE_TAGS := eng debug` deprecation {#LOCAL_MODULE_TAGS}
+## `LOCAL_MODULE_TAGS := eng debug` are obsolete {#LOCAL_MODULE_TAGS}
-`LOCAL_MODULE_TAGS` value `eng` and `debug` are being deprecated. They allowed
+`LOCAL_MODULE_TAGS` value `eng` and `debug` are now obsolete. They allowed
modules to specify that they should always be installed on `-eng`, or `-eng`
and `-userdebug` builds. This conflicted with the ability for products to
specify which modules should be installed, effectively making it impossible to
@@ -194,11 +212,9 @@
## `export` and `unexport` deprecation {#export_keyword}
-The `export` and `unexport` keywords have been deprecated, and will throw
-warnings or errors depending on where they are used.
+The `export` and `unexport` keywords are obsolete, and will throw errors when
+used.
-Early in the make system, during product configuration and BoardConfig.mk
-reading: these will throw a warnings, and will be an error in the future.
Device specific configuration should not be able to affect common core build
steps -- we're looking at triggering build steps to be invalidated if the set
of environment variables they can access changes. If device specific
@@ -206,10 +222,9 @@
output directory could become significantly more expensive than it already can
be.
-Later, during Android.mk files, and later tasks: these will throw errors, since
-it is increasingly likely that they are being used incorrectly, attempting to
-change the environment for a single build step, and instead setting it for
-hundreds of thousands.
+If used during Android.mk files, and later tasks, it is increasingly likely
+that they are being used incorrectly. Attempting to change the environment for
+a single build step, and instead setting it for hundreds of thousands.
It is not recommended to just move the environment variable setting outside of
the build (in vendorsetup.sh, or some other configuration script or wrapper).
@@ -373,7 +388,7 @@
| instead of | use |
|--------------------------------------------------------------|----------------------|
-| OUT {#OUT} | OUT_DIR |
+| OUT {#OUT} | PRODUCT_OUT |
| ANDROID_HOST_OUT {#ANDROID_HOST_OUT} | HOST_OUT |
| ANDROID_PRODUCT_OUT {#ANDROID_PRODUCT_OUT} | PRODUCT_OUT |
| ANDROID_HOST_OUT_TESTCASES {#ANDROID_HOST_OUT_TESTCASES} | HOST_OUT_TESTCASES |
diff --git a/Deprecation.md b/Deprecation.md
index 0d925cb..131ec0d 100644
--- a/Deprecation.md
+++ b/Deprecation.md
@@ -14,16 +14,16 @@
| Module type | State |
| -------------------------------- | --------- |
-| `BUILD_AUX_EXECUTABLE` | Warning |
-| `BUILD_AUX_STATIC_LIBRARY` | Warning |
-| `BUILD_HOST_FUZZ_TEST` | Warning |
-| `BUILD_HOST_NATIVE_TEST` | Warning |
+| `BUILD_AUX_EXECUTABLE` | Error |
+| `BUILD_AUX_STATIC_LIBRARY` | Error |
+| `BUILD_HOST_FUZZ_TEST` | Error |
+| `BUILD_HOST_NATIVE_TEST` | Error |
| `BUILD_HOST_SHARED_TEST_LIBRARY` | Error |
-| `BUILD_HOST_STATIC_TEST_LIBRARY` | Warning |
+| `BUILD_HOST_STATIC_TEST_LIBRARY` | Error |
| `BUILD_HOST_TEST_CONFIG` | Error |
-| `BUILD_NATIVE_BENCHMARK` | Warning |
+| `BUILD_NATIVE_BENCHMARK` | Error |
| `BUILD_SHARED_TEST_LIBRARY` | Error |
-| `BUILD_STATIC_TEST_LIBRARY` | Warning |
+| `BUILD_STATIC_TEST_LIBRARY` | Error |
| `BUILD_TARGET_TEST_CONFIG` | Error |
| `BUILD_*` | Available |
diff --git a/core/Makefile b/core/Makefile
index a4eb0f3..c6c4621 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -466,7 +466,7 @@
endif
endif
-$(INSTALLED_BUILD_PROP_TARGET): $(intermediate_system_build_prop) $(INSTALLED_RECOVERYIMAGE_TARGET)
+$(INSTALLED_BUILD_PROP_TARGET): $(intermediate_system_build_prop)
@echo "Target build info: $@"
$(hide) grep -v 'ro.product.first_api_level' $(intermediate_system_build_prop) > $@
@@ -1224,19 +1224,9 @@
# The kernel isn't really a module, so to get its module file in there, we
# make the target NOTICE files depend on this particular file too, which will
# then be in the right directory for the find in combine-notice-files to work.
-$(kernel_notice_file): \
- $(BUILD_SYSTEM)/LINUX_KERNEL_COPYING \
- | $(ACP)
- @echo Copying: $@
- $(hide) mkdir -p $(dir $@)
- $(hide) $(ACP) $< $@
+$(eval $(call copy-one-file,$(BUILD_SYSTEM)/LINUX_KERNEL_COPYING,$(kernel_notice_file)))
-$(winpthreads_notice_file): \
- $(BUILD_SYSTEM)/WINPTHREADS_COPYING \
- | $(ACP)
- @echo Copying: $@
- $(hide) mkdir -p $(dir $@)
- $(hide) $(ACP) $< $@
+$(eval $(call copy-one-file,$(BUILD_SYSTEM)/WINPTHREADS_COPYING,$(winpthreads_notice_file)))
# #################################################################
@@ -1832,8 +1822,6 @@
INTERNAL_RECOVERYIMAGE_ARGS += --dtb $(INSTALLED_DTBIMAGE_TARGET)
endif
-RECOVERYIMAGE_ID_FILE := $(PRODUCT_OUT)/recovery.id
-
# $(1): output file
define build-recoveryimage-target
# Making recovery image
@@ -1868,7 +1856,7 @@
$(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk)
$(if $(filter true,$(PRODUCT_SUPPORTS_VBOOT)), \
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1).unsigned, \
- $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1) --id > $(RECOVERYIMAGE_ID_FILE))
+ $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1))
$(if $(filter true,$(PRODUCT_SUPPORTS_BOOT_SIGNER)),\
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\
$(BOOT_SIGNER) /boot $(1) $(PRODUCT_VERITY_SIGNING_KEY).pk8 $(PRODUCT_VERITY_SIGNING_KEY).x509.pem $(1),\
@@ -4083,7 +4071,7 @@
endif
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
@# If breakpad symbols have been generated, add them to the zip.
- $(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD
+ $(hide) cp -R $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD
endif
ifdef BOARD_PREBUILT_VENDORIMAGE
$(hide) mkdir -p $(zip_root)/IMAGES
@@ -4182,8 +4170,9 @@
$(if $(_group_partition_list), \
echo "$(group)_partition_list=$(_group_partition_list)" >> $(zip_root)/META/dynamic_partitions_info.txt;))
endif # BOARD_SUPER_PARTITION_GROUPS
+ @# TODO(b/134525174): Remove `-r` after addressing the issue with recovery patch generation.
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
- build/make/tools/releasetools/add_img_to_target_files -a -v -p $(HOST_OUT) $(zip_root)
+ build/make/tools/releasetools/add_img_to_target_files -a -r -v -p $(HOST_OUT) $(zip_root)
@# Zip everything up, preserving symlinks and placing META/ files first to
@# help early validation of the .zip file while uploading it.
$(hide) find $(zip_root)/META | sort >$@.list
@@ -4444,6 +4433,7 @@
# For real devices and for dist builds, build super image from target files to an intermediate directory.
INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img
+INTERNAL_SUPERIMAGE_MISC_INFO := $(call intermediates-dir-for,PACKAGING,superimage_debug)/misc_info.txt
$(INTERNAL_SUPERIMAGE_DIST_TARGET): extracted_input_target_files := $(patsubst %.zip,%,$(BUILT_TARGET_FILES_PACKAGE))
$(INTERNAL_SUPERIMAGE_DIST_TARGET): $(LPMAKE) $(BUILT_TARGET_FILES_PACKAGE) $(BUILD_SUPER_IMAGE)
$(call pretty,"Target super fs image from target files: $@")
@@ -4495,7 +4485,7 @@
$(INSTALLED_SUPERIMAGE_TARGET): $(INSTALLED_SUPERIMAGE_DEPENDENCIES)
$(call pretty,"Target super fs image for debug: $@")
$(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\
- $(call intermediates-dir-for,PACKAGING,superimage_debug)/misc_info.txt)
+ $(INTERNAL_SUPERIMAGE_MISC_INFO))
droidcore: $(INSTALLED_SUPERIMAGE_TARGET)
@@ -4569,6 +4559,7 @@
$(foreach device,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \
OTA/super_$(device).img:super_$(device).img)) \
OTA/android-info.txt:android-info.txt "IMAGES/*.img:."
+ $(if $(INTERNAL_SUPERIMAGE_MISC_INFO), zip -q -j -u $@ $(INTERNAL_SUPERIMAGE_MISC_INFO))
$(if $(INTERNAL_SUPERIMAGE_DIST_TARGET), zip -q -j -u $@ $(INTERNAL_SUPERIMAGE_DIST_TARGET))
else
$(INTERNAL_UPDATE_PACKAGE_TARGET):
diff --git a/core/app_prebuilt_internal.mk b/core/app_prebuilt_internal.mk
index dd263dd..69f411c 100644
--- a/core/app_prebuilt_internal.mk
+++ b/core/app_prebuilt_internal.mk
@@ -92,6 +92,32 @@
endif
endif
+# Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES
+# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
+# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
+# Will change the default to true unconditionally in the future.
+ifndef LOCAL_ENFORCE_USES_LIBRARIES
+ ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES)))
+ LOCAL_ENFORCE_USES_LIBRARIES := true
+ endif
+endif
+
+my_enforced_uses_libraries :=
+ifdef LOCAL_ENFORCE_USES_LIBRARIES
+ my_enforced_uses_libraries := $(intermediates.COMMON)/enforce_uses_libraries.timestamp
+ $(my_enforced_uses_libraries): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES)
+ $(my_enforced_uses_libraries): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES)
+ $(my_enforced_uses_libraries): $(BUILD_SYSTEM)/verify_uses_libraries.sh $(AAPT)
+ $(my_enforced_uses_libraries): $(my_prebuilt_src_file)
+ @echo Verifying uses-libraries: $<
+ aapt_binary=$(AAPT) \
+ uses_library_names="$(strip $(PRIVATE_USES_LIBRARIES))" \
+ optional_uses_library_names="$(strip $(PRIVATE_OPTIONAL_USES_LIBRARIES))" \
+ $(BUILD_SYSTEM)/verify_uses_libraries.sh $<
+ touch $@
+ $(built_module) : $(my_enforced_uses_libraries)
+endif
+
dex_preopt_profile_src_file := $(my_prebuilt_src_file)
rs_compatibility_jni_libs :=
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 94aa1e4..6c7e883 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -167,19 +167,14 @@
ifeq (true,$(LOCAL_UNINSTALLABLE_MODULE))
$(call pretty-warning,LOCAL_MODULE_TAGS := $(my_bad_module_tags) does not do anything for uninstallable modules)
endif
- ifneq ($(BUILD_BROKEN_ENG_DEBUG_TAGS),true)
- $(call pretty-error,LOCAL_MODULE_TAGS := $(my_bad_module_tags) is obsolete. See $(CHANGES_URL)#LOCAL_MODULE_TAGS)
- else
- $(call pretty-warning,LOCAL_MODULE_TAGS := $(my_bad_module_tags) is deprecated. See $(CHANGES_URL)#LOCAL_MODULE_TAGS)
- endif
- my_bad_module_tags :=
+ $(call pretty-error,LOCAL_MODULE_TAGS := $(my_bad_module_tags) is obsolete. See $(CHANGES_URL)#LOCAL_MODULE_TAGS)
endif
# Only the tags mentioned in this test are expected to be set by module
# makefiles. Anything else is either a typo or a source of unexpected
# behaviors.
-ifneq ($(filter-out debug eng tests optional samples,$(my_module_tags)),)
-$(call pretty-error,unusual tags: $(filter-out debug eng tests optional samples,$(my_module_tags)))
+ifneq ($(filter-out tests optional samples,$(my_module_tags)),)
+$(call pretty-error,unusual tags: $(filter-out tests optional samples,$(my_module_tags)))
endif
# Add implicit tags.
@@ -892,13 +887,13 @@
# Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
ALL_DEPS.MODULES := $(ALL_DEPS.MODULES) $(LOCAL_MODULE)
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
- $(ALL_MODULES.$(LOCAL_MODULE).ALL_DEPS) \
+ $(ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS) \
$(LOCAL_STATIC_LIBRARIES) \
$(LOCAL_WHOLE_STATIC_LIBRARIES) \
$(LOCAL_SHARED_LIBRARIES) \
$(LOCAL_HEADER_LIBRARIES) \
$(LOCAL_STATIC_JAVA_LIBRARIES) \
- $(LOCAL_JAVA_LIBRARIES)\
+ $(LOCAL_JAVA_LIBRARIES) \
$(LOCAL_JNI_SHARED_LIBRARIES))
ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files))
diff --git a/core/board_config.mk b/core/board_config.mk
index e14ba00..9c9e8b1 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -85,9 +85,7 @@
_board_strip_readonly_list += $(_dynamic_partitions_var_list)
_build_broken_var_list := \
- BUILD_BROKEN_ANDROIDMK_EXPORTS \
BUILD_BROKEN_DUP_RULES \
- BUILD_BROKEN_ENG_DEBUG_TAGS \
BUILD_BROKEN_USES_NETWORK \
_build_broken_var_list += \
@@ -230,10 +228,6 @@
TARGET_CPU_ABI_LIST_32_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_32_BIT)))
TARGET_CPU_ABI_LIST_64_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_64_BIT)))
-ifneq ($(BUILD_BROKEN_ANDROIDMK_EXPORTS),true)
-$(KATI_obsolete_export It is a global setting. See $(CHANGES_URL)#export_keyword)
-endif
-
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_RAMDISK
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index fafdce6..5973e0e 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -269,6 +269,7 @@
LOCAL_SOONG_SYMBOL_PATH :=
LOCAL_SOONG_TOC :=
LOCAL_SOONG_UNSTRIPPED_BINARY :=
+LOCAL_SOONG_VNDK_VERSION :=
# '',true
LOCAL_SOURCE_FILES_ALL_GENERATED:=
LOCAL_SRC_FILES:=
diff --git a/core/config.mk b/core/config.mk
index 57c1d7a..ee2db4f 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -97,9 +97,10 @@
$(KATI_obsolete_var TARGET_ROOT_OUT_SBIN_UNSTRIPPED,/sbin has been removed, use /system/bin instead)
$(KATI_obsolete_var BUILD_BROKEN_PHONY_TARGETS)
$(KATI_obsolete_var BUILD_BROKEN_DUP_COPY_HEADERS)
-
-# This is marked as obsolete in envsetup.mk after reading the BoardConfig.mk
-$(KATI_deprecate_export It is a global setting. See $(CHANGES_URL)#export_keyword)
+$(KATI_obsolete_var BUILD_BROKEN_ENG_DEBUG_TAGS)
+$(KATI_obsolete_export It is a global setting. See $(CHANGES_URL)#export_keyword)
+$(KATI_obsolete_var BUILD_BROKEN_ANDROIDMK_EXPORTS)
+$(KATI_obsolete_var PRODUCT_STATIC_BOOT_CONTROL_HAL,Use shared library module instead. See $(CHANGES_URL)#PRODUCT_STATIC_BOOT_CONTROL_HAL)
# Used to force goals to build. Only use for conditionally defined goals.
.PHONY: FORCE
@@ -807,6 +808,7 @@
26.0 \
27.0 \
28.0 \
+ 29.0 \
.KATI_READONLY := \
PLATFORM_SEPOLICY_COMPAT_VERSIONS \
@@ -1118,8 +1120,11 @@
endif
# Missing optional uses-libraries so that the platform doesn't create build rules that depend on
-# them. See setup_one_odex.mk.
-INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := com.google.android.ble com.google.android.wearable
+# them.
+INTERNAL_PLATFORM_MISSING_USES_LIBRARIES := \
+ com.google.android.ble \
+ com.google.android.media.effects \
+ com.google.android.wearable \
# This is the standard way to name a directory containing prebuilt target
# objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
diff --git a/core/construct_context.sh b/core/construct_context.sh
index 399c15d..794795a 100755
--- a/core/construct_context.sh
+++ b/core/construct_context.sh
@@ -22,6 +22,11 @@
# class_loader_context_arg: final class loader conext arg
# stored_class_loader_context_arg: final stored class loader context arg
+if [ -z "${target_sdk_version}" ]; then
+ echo "ERROR: target_sdk_version not set"
+ exit 2
+fi
+
# The hidl.manager shared library has a dependency on hidl.base. We'll manually
# add that information to the class loader context if we see those libraries.
hidl_manager="android.hidl.manager-V1.0-java"
diff --git a/core/definitions.mk b/core/definitions.mk
index af6248d..5d3227a 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -425,8 +425,8 @@
define find-subdir-assets
$(sort $(if $(1),$(patsubst ./%,%, \
- $(shell if [ -d $(1) ] ; then cd $(1) ; find -L ./ -not -name '.*' -and -type f ; fi)), \
- $(warning Empty argument supplied to find-subdir-assets in $(LOCAL_PATH)) \
+ $(shell if [ -d $(1) ] ; then cd $(1) ; find -L ./ -not -name '.*' -and -type f ; fi)), \
+ $(warning Empty argument supplied to find-subdir-assets in $(LOCAL_PATH)) \
))
endef
@@ -782,8 +782,8 @@
#TODO(jbq): as of 20100106 nobody uses the second parameter
define get-tagged-modules
$(filter-out \
- $(call modules-for-tag-list,$(2)), \
- $(call modules-for-tag-list,$(1)))
+ $(call modules-for-tag-list,$(2)), \
+ $(call modules-for-tag-list,$(1)))
endef
###########################################################
@@ -950,16 +950,16 @@
@echo "Renderscript compatibility: $(notdir $@) <= $(notdir $<)"
$(hide) mkdir -p $(dir $@)
$(hide) $(BCC_COMPAT) -O3 -o $(dir $@)/$(notdir $(<:.bc=.o)) -fPIC -shared \
- -rt-path $(RS_PREBUILT_CLCORE) -mtriple $(RS_COMPAT_TRIPLE) $<
+ -rt-path $(RS_PREBUILT_CLCORE) -mtriple $(RS_COMPAT_TRIPLE) $<
$(hide) $(PRIVATE_CXX) -shared -Wl,-soname,$(notdir $@) -nostdlib \
- -Wl,-rpath,\$$ORIGIN/../lib \
- $(dir $@)/$(notdir $(<:.bc=.o)) \
- $(RS_PREBUILT_COMPILER_RT) \
- -o $@ $(CLANG_TARGET_GLOBAL_LDFLAGS) -Wl,--hash-style=sysv \
- -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib64 \
- -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib \
- $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport)/libRSSupport.so \
- -lm -lc
+ -Wl,-rpath,\$$ORIGIN/../lib \
+ $(dir $@)/$(notdir $(<:.bc=.o)) \
+ $(RS_PREBUILT_COMPILER_RT) \
+ -o $@ $(CLANG_TARGET_GLOBAL_LDFLAGS) -Wl,--hash-style=sysv \
+ -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib64 \
+ -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib \
+ $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport)/libRSSupport.so \
+ -lm -lc
endef
###########################################################
@@ -1093,10 +1093,10 @@
@echo "Protoc: $@ <= $<"
@mkdir -p $(dir $@)
$(hide) \
- $(PROTOC) \
- $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
- $(PRIVATE_PROTOC_FLAGS) \
- $<
+ $(PROTOC) \
+ $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
+ $(PRIVATE_PROTOC_FLAGS) \
+ $<
@# aprotoc outputs only .cc. Rename it to .cpp if necessary.
$(if $(PRIVATE_RENAME_CPP_EXT),\
$(hide) mv $(basename $@).cc $@)
@@ -1122,19 +1122,19 @@
###########################################################
define transform-cpp-to-o-compiler-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
- $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \
- $(PRIVATE_ARM_CFLAGS) \
- ) \
- $(PRIVATE_RTTI_FLAG) \
- $(PRIVATE_CFLAGS) \
- $(PRIVATE_CPPFLAGS) \
- $(PRIVATE_DEBUG_CFLAGS) \
- $(PRIVATE_CFLAGS_NO_OVERRIDE) \
- $(PRIVATE_CPPFLAGS_NO_OVERRIDE)
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \
+ $(PRIVATE_ARM_CFLAGS) \
+ ) \
+$(PRIVATE_RTTI_FLAG) \
+$(PRIVATE_CFLAGS) \
+$(PRIVATE_CPPFLAGS) \
+$(PRIVATE_DEBUG_CFLAGS) \
+$(PRIVATE_CFLAGS_NO_OVERRIDE) \
+$(PRIVATE_CPPFLAGS_NO_OVERRIDE)
endef
# PATH_TO_CLANG_TIDY is defined in build/soong
@@ -1172,14 +1172,14 @@
# $(1): extra flags
define transform-c-or-s-to-o-compiler-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
- $(PRIVATE_TARGET_GLOBAL_CONLYFLAGS) \
- $(PRIVATE_ARM_CFLAGS) \
- ) \
- $(1)
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CONLYFLAGS) \
+ $(PRIVATE_ARM_CFLAGS) \
+ ) \
+ $(1)
endef
define transform-c-to-o-compiler-args
@@ -1245,17 +1245,17 @@
###########################################################
define transform-host-cpp-to-o-compiler-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_CFLAGS) \
- $(PRIVATE_HOST_GLOBAL_CPPFLAGS) \
- ) \
- $(PRIVATE_CFLAGS) \
- $(PRIVATE_CPPFLAGS) \
- $(PRIVATE_DEBUG_CFLAGS) \
- $(PRIVATE_CFLAGS_NO_OVERRIDE) \
- $(PRIVATE_CPPFLAGS_NO_OVERRIDE)
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_CFLAGS) \
+ $(PRIVATE_HOST_GLOBAL_CPPFLAGS) \
+ ) \
+$(PRIVATE_CFLAGS) \
+$(PRIVATE_CPPFLAGS) \
+$(PRIVATE_DEBUG_CFLAGS) \
+$(PRIVATE_CFLAGS_NO_OVERRIDE) \
+$(PRIVATE_CPPFLAGS_NO_OVERRIDE)
endef
define clang-tidy-host-cpp
@@ -1285,12 +1285,12 @@
###########################################################
define transform-host-c-or-s-to-o-common-args
- $(c-includes) \
- -c \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_CFLAGS) \
- $(PRIVATE_HOST_GLOBAL_CONLYFLAGS) \
- )
+$(c-includes) \
+-c \
+$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_CFLAGS) \
+ $(PRIVATE_HOST_GLOBAL_CONLYFLAGS) \
+ )
endef
# $(1): extra flags
@@ -1534,15 +1534,15 @@
define transform-o-to-aux-executable-inner
$(hide) $(PRIVATE_CXX) -pie \
- -Bdynamic \
- -Wl,--gc-sections \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(PRIVATE_LDFLAGS) \
- -o $@
+ -Bdynamic \
+ -Wl,--gc-sections \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(PRIVATE_LDFLAGS) \
+ -o $@
endef
define transform-o-to-aux-executable
@@ -1553,16 +1553,16 @@
define transform-o-to-aux-static-executable-inner
$(hide) $(PRIVATE_CXX) \
- -Bstatic \
- -Wl,--gc-sections \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(PRIVATE_LDFLAGS) \
- -Wl,-Map=$(@).map \
- -o $@
+ -Bstatic \
+ -Wl,--gc-sections \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(PRIVATE_LDFLAGS) \
+ -Wl,-Map=$(@).map \
+ -o $@
endef
define transform-o-to-aux-static-executable
@@ -1654,25 +1654,25 @@
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-shared-lib-inner
$(hide) $(PRIVATE_CXX) \
- -Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
- -Wl,-rpath,\$$ORIGIN/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
- -shared -Wl,-soname,$(notdir $@) \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
- ) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- -o $@ \
- $(PRIVATE_LDLIBS)
+ -Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
+ -Wl,-rpath,\$$ORIGIN/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OUT_SHARED_LIBRARIES)) \
+ -shared -Wl,-soname,$(notdir $@) \
+ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
+ ) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ -o $@ \
+ $(PRIVATE_LDLIBS)
endef
endif
@@ -1695,27 +1695,27 @@
define transform-o-to-shared-lib-inner
$(hide) $(PRIVATE_CXX) \
- -nostdlib -Wl,-soname,$(notdir $@) \
- -Wl,--gc-sections \
- -shared \
- $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
- $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
- $(PRIVATE_TARGET_LIBATOMIC) \
- $(PRIVATE_TARGET_LIBGCC) \
- $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- -o $@ \
- $(PRIVATE_TARGET_CRTEND_SO_O) \
- $(PRIVATE_LDLIBS)
+ -nostdlib -Wl,-soname,$(notdir $@) \
+ -Wl,--gc-sections \
+ -shared \
+ $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
+ $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
+ $(PRIVATE_TARGET_LIBATOMIC) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ -o $@ \
+ $(PRIVATE_TARGET_CRTEND_SO_O) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-shared-lib
@@ -1730,28 +1730,28 @@
define transform-o-to-executable-inner
$(hide) $(PRIVATE_CXX) -pie \
- -nostdlib -Bdynamic \
- -Wl,-dynamic-linker,$(PRIVATE_LINKER) \
- -Wl,--gc-sections \
- -Wl,-z,nocopyreloc \
- $(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
- $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
- $(PRIVATE_TARGET_LIBATOMIC) \
- $(PRIVATE_TARGET_LIBGCC) \
- $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- -o $@ \
- $(PRIVATE_TARGET_CRTEND_O) \
- $(PRIVATE_LDLIBS)
+ -nostdlib -Bdynamic \
+ -Wl,-dynamic-linker,$(PRIVATE_LINKER) \
+ -Wl,--gc-sections \
+ -Wl,-z,nocopyreloc \
+ $(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
+ $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
+ $(PRIVATE_TARGET_LIBATOMIC) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ -o $@ \
+ $(PRIVATE_TARGET_CRTEND_O) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-executable
@@ -1773,28 +1773,28 @@
define transform-o-to-static-executable-inner
$(hide) $(PRIVATE_CXX) \
- -nostdlib -Bstatic \
- $(if $(filter $(PRIVATE_LDFLAGS),-shared),,-static) \
- -Wl,--gc-sections \
- -o $@ \
- $(PRIVATE_TARGET_CRTBEGIN_STATIC_O) \
- $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
- $(PRIVATE_LDFLAGS) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(filter-out %libcompiler_rt.hwasan.a %libc_nomalloc.hwasan.a %libc.hwasan.a %libcompiler_rt.a %libc_nomalloc.a %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- -Wl,--start-group \
- $(filter %libc.a %libc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(filter %libc_nomalloc.a %libc_nomalloc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
- $(PRIVATE_TARGET_LIBATOMIC) \
- $(filter %libcompiler_rt.a %libcompiler_rt.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
- $(PRIVATE_TARGET_LIBGCC) \
- -Wl,--end-group \
- $(PRIVATE_TARGET_CRTEND_O)
+ -nostdlib -Bstatic \
+ $(if $(filter $(PRIVATE_LDFLAGS),-shared),,-static) \
+ -Wl,--gc-sections \
+ -o $@ \
+ $(PRIVATE_TARGET_CRTBEGIN_STATIC_O) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(filter-out %libcompiler_rt.hwasan.a %libc_nomalloc.hwasan.a %libc.hwasan.a %libcompiler_rt.a %libc_nomalloc.a %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ -Wl,--start-group \
+ $(filter %libc.a %libc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(filter %libc_nomalloc.a %libc_nomalloc.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \
+ $(PRIVATE_TARGET_LIBATOMIC) \
+ $(filter %libcompiler_rt.a %libcompiler_rt.hwasan.a,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(PRIVATE_TARGET_LIBCRT_BUILTINS) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ -Wl,--end-group \
+ $(PRIVATE_TARGET_CRTEND_O)
endef
define transform-o-to-static-executable
@@ -1811,24 +1811,24 @@
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-executable-inner
$(hide) $(PRIVATE_CXX) \
- $(PRIVATE_ALL_OBJECTS) \
- -Wl,--whole-archive \
- $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
- -Wl,--no-whole-archive \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
- $(PRIVATE_ALL_STATIC_LIBRARIES) \
- $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
- $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
- $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
- $(PRIVATE_ALL_SHARED_LIBRARIES) \
- $(foreach path,$(PRIVATE_RPATHS), \
- -Wl,-rpath,\$$ORIGIN/$(path)) \
- $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
- ) \
- $(PRIVATE_LDFLAGS) \
- -o $@ \
- $(PRIVATE_LDLIBS)
+ $(PRIVATE_ALL_OBJECTS) \
+ -Wl,--whole-archive \
+ $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
+ -Wl,--no-whole-archive \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \
+ $(PRIVATE_ALL_STATIC_LIBRARIES) \
+ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),-lgcov) \
+ $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_HOST_LIBPROFILE_RT)) \
+ $(PRIVATE_ALL_SHARED_LIBRARIES) \
+ $(foreach path,$(PRIVATE_RPATHS), \
+ -Wl,-rpath,\$$ORIGIN/$(path)) \
+ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
+ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
+ ) \
+ $(PRIVATE_LDFLAGS) \
+ -o $@ \
+ $(PRIVATE_LDLIBS)
endef
endif
@@ -1853,15 +1853,15 @@
-name Manifest.java 2> /dev/null`; do \
dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_MANIFEST_FILE`; \
mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
- $(ACP) -fp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
+ cp $$GENERATED_MANIFEST_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
done;
$(hide) for GENERATED_R_FILE in `find $(1) \
-name R.java 2> /dev/null`; do \
dir=`awk '/package/{gsub(/\./,"/",$$2);gsub(/;/,"",$$2);print $$2;exit}' $$GENERATED_R_FILE`; \
mkdir -p $(TARGET_COMMON_OUT_ROOT)/R/$$dir; \
- $(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
+ cp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
|| exit 31; \
- $(ACP) -fp $$GENERATED_R_FILE $(2) || exit 32; \
+ cp $$GENERATED_R_FILE $(2) || exit 32; \
done;
@# Ensure that the target file is always created, i.e. also in case we did not
@# enter the GENERATED_R_FILE-loop above. This avoids unnecessary rebuilding.
@@ -2724,60 +2724,6 @@
###########################################################
-# Override the package defined in $(1), setting the
-# variables listed below differently.
-#
-# $(1): The makefile to override (relative to the source
-# tree root)
-# $(2): Old LOCAL_PACKAGE_NAME value.
-# $(3): New LOCAL_PACKAGE_NAME value.
-# $(4): New LOCAL_MANIFEST_PACKAGE_NAME value.
-# $(5): New LOCAL_CERTIFICATE value.
-# $(6): New LOCAL_INSTRUMENTATION_FOR value.
-# $(7): New LOCAL_MANIFEST_INSTRUMENTATION_FOR value.
-# $(8): New LOCAL_COMPATIBILITY_SUITE value.
-#
-# Note that LOCAL_PACKAGE_OVERRIDES is NOT cleared in
-# clear_vars.mk.
-###########################################################
-define inherit-package
- $(eval $(call inherit-package-internal,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8)))
-endef
-
-define inherit-package-internal
- LOCAL_PACKAGE_OVERRIDES \
- := $(strip $(1))||$(strip $(2))||$(strip $(3))||$(strip $(4))||&&$(strip $(5))||&&$(strip $(6))||&&$(strip $(7))||&&$(strip $(8)) $(LOCAL_PACKAGE_OVERRIDES)
- include $(1)
- LOCAL_PACKAGE_OVERRIDES \
- := $(wordlist 1,$(words $(LOCAL_PACKAGE_OVERRIDES)), $(LOCAL_PACKAGE_OVERRIDES))
-endef
-
-# To be used with inherit-package above
-# Evalutes to true if the package was overridden
-define set-inherited-package-variables
-$(strip $(call set-inherited-package-variables-internal))
-endef
-
-define keep-or-override
-$(eval $(1) := $(if $(2),$(2),$($(1))))
-endef
-
-define set-inherited-package-variables-internal
- $(eval _o := $(subst ||, ,$(lastword $(LOCAL_PACKAGE_OVERRIDES))))
- $(eval _n := $(subst ||, ,$(firstword $(LOCAL_PACKAGE_OVERRIDES))))
- $(if $(filter $(word 2,$(_n)),$(LOCAL_PACKAGE_NAME)), \
- $(eval LOCAL_PACKAGE_NAME := $(word 3,$(_o))) \
- $(eval LOCAL_MANIFEST_PACKAGE_NAME := $(word 4,$(_o))) \
- $(call keep-or-override,LOCAL_CERTIFICATE,$(patsubst &&%,%,$(word 5,$(_o)))) \
- $(call keep-or-override,LOCAL_INSTRUMENTATION_FOR,$(patsubst &&%,%,$(word 6,$(_o)))) \
- $(call keep-or-override,LOCAL_MANIFEST_INSTRUMENTATION_FOR,$(patsubst &&%,%,$(word 7,$(_o)))) \
- $(call keep-or-override,LOCAL_COMPATIBILITY_SUITE,$(patsubst &&%,%,$(word 8,$(_o)))) \
- $(eval LOCAL_OVERRIDES_PACKAGES := $(sort $(LOCAL_OVERRIDES_PACKAGES) $(word 2,$(_o)))) \
- true \
- ,)
-endef
-
-###########################################################
## API Check
###########################################################
@@ -3309,7 +3255,8 @@
$(KATI_obsolete_var \
create-empty-package \
initialize-package-file \
- add-jni-shared-libs-to-package,\
+ add-jni-shared-libs-to-package \
+ inherit-package,\
These functions have been removed)
###########################################################
@@ -3323,7 +3270,7 @@
define verify-vndk-libs-identical
@echo "Checking VNDK vendor variant: $(2)"
$(hide) CLANG_BIN="$(LLVM_PREBUILTS_PATH)" \
- CROSS_COMPILE="$(strip $(3))" \
- XZ="$(XZ)" \
- $(LIBRARY_IDENTITY_CHECK_SCRIPT) $(SOONG_STRIP_PATH) $(1) $(2)
+ CROSS_COMPILE="$(strip $(3))" \
+ XZ="$(XZ)" \
+ $(LIBRARY_IDENTITY_CHECK_SCRIPT) $(SOONG_STRIP_PATH) $(1) $(2)
endef
diff --git a/core/deprecation.mk b/core/deprecation.mk
index 11fe290..f1e198d 100644
--- a/core/deprecation.mk
+++ b/core/deprecation.mk
@@ -28,19 +28,19 @@
# relevant BUILD_BROKEN_USES_BUILD_* variables, then these would move to
# DEFAULT_ERROR_BUILD_MODULE_TYPES.
DEFAULT_WARNING_BUILD_MODULE_TYPES :=$= \
- BUILD_AUX_EXECUTABLE \
- BUILD_AUX_STATIC_LIBRARY \
- BUILD_HOST_FUZZ_TEST \
- BUILD_HOST_NATIVE_TEST \
- BUILD_HOST_STATIC_TEST_LIBRARY \
- BUILD_NATIVE_BENCHMARK \
- BUILD_STATIC_TEST_LIBRARY \
# These are BUILD_* variables that are errors to reference, but you can set
# BUILD_BROKEN_USES_BUILD_* in your BoardConfig.mk in order to turn them back
# to warnings.
DEFAULT_ERROR_BUILD_MODULE_TYPES :=$= \
+ BUILD_AUX_EXECUTABLE \
+ BUILD_AUX_STATIC_LIBRARY \
+ BUILD_HOST_FUZZ_TEST \
+ BUILD_HOST_NATIVE_TEST \
+ BUILD_HOST_STATIC_TEST_LIBRARY \
BUILD_HOST_TEST_CONFIG \
+ BUILD_NATIVE_BENCHMARK \
+ BUILD_STATIC_TEST_LIBRARY \
BUILD_TARGET_TEST_CONFIG \
# These are BUILD_* variables that are always errors to reference.
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index c44e4bd..5693147 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -116,7 +116,6 @@
$(call add_json_bool, NeverSystemServerDebugInfo, $(filter false,$(PRODUCT_SYSTEM_SERVER_DEBUG_INFO)))
$(call add_json_bool, AlwaysOtherDebugInfo, $(filter true,$(PRODUCT_OTHER_JAVA_DEBUG_INFO)))
$(call add_json_bool, NeverOtherDebugInfo, $(filter false,$(PRODUCT_OTHER_JAVA_DEBUG_INFO)))
- $(call add_json_list, MissingUsesLibraries, $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES))
$(call add_json_bool, IsEng, $(filter eng,$(TARGET_BUILD_VARIANT)))
$(call add_json_bool, SanitizeLite, $(SANITIZE_LITE))
$(call add_json_bool, DefaultAppImages, $(WITH_DEX_PREOPT_APP_IMAGE))
@@ -152,7 +151,7 @@
$(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)
+ $(call add_json_str, ManifestCheck, $(SOONG_HOST_OUT_EXECUTABLES)/manifest_check)
$(call add_json_str, ConstructContext, $(BUILD_SYSTEM)/construct_context.sh)
$(call end_json_map)
@@ -175,7 +174,6 @@
$(SOONG_HOST_OUT_EXECUTABLES)/aapt \
$(SOONG_ZIP) \
$(ZIP2ZIP) \
- $(BUILD_SYSTEM)/verify_uses_libraries.sh \
$(BUILD_SYSTEM)/construct_context.sh \
DEXPREOPT_STRIP_DEPS := \
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 266ebd2..9832c2f 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -103,18 +103,6 @@
endif
endif
-# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
-# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
-ifeq (,$(LOCAL_ENFORCE_USES_LIBRARIES))
- # Will change the default to true unconditionally in the future.
- ifneq (,$(LOCAL_OPTIONAL_USES_LIBRARIES))
- LOCAL_ENFORCE_USES_LIBRARIES := true
- endif
- ifneq (,$(LOCAL_USES_LIBRARIES))
- LOCAL_ENFORCE_USES_LIBRARIES := true
- endif
-endif
-
my_dexpreopt_archs :=
my_dexpreopt_images :=
my_dexpreopt_infix := boot
@@ -183,6 +171,22 @@
endif # TARGET_2ND_ARCH
endif # LOCAL_MODULE_CLASS
+ my_filtered_optional_uses_libraries := $(filter-out $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES), \
+ $(LOCAL_OPTIONAL_USES_LIBRARIES))
+
+ # dexpreopt needs the paths to the dex jars of these libraries in case
+ # construct_context.sh needs to pass them to dex2oat.
+ my_extra_dexpreopt_libs := \
+ org.apache.http.legacy \
+ android.hidl.base-V1.0-java \
+ android.hidl.manager-V1.0-java \
+
+ my_dexpreopt_libs := $(sort \
+ $(LOCAL_USES_LIBRARIES) \
+ $(my_filtered_optional_uses_libraries) \
+ $(my_extra_dexpreopt_libs) \
+ )
+
# Record dex-preopt config.
DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT)
DEXPREOPT.$(LOCAL_MODULE).MULTILIB := $(LOCAL_MULTILIB)
@@ -202,6 +206,7 @@
$(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, ManifestPath, $(full_android_manifest))
$(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)))
@@ -210,10 +215,10 @@
$(call add_json_str, ProfileClassListing, $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE)))
$(call add_json_bool, ProfileIsTextListing, $(my_profile_is_text_listing))
$(call add_json_bool, EnforceUsesLibraries, $(LOCAL_ENFORCE_USES_LIBRARIES))
- $(call add_json_list, OptionalUsesLibraries, $(LOCAL_OPTIONAL_USES_LIBRARIES))
+ $(call add_json_list, OptionalUsesLibraries, $(my_filtered_optional_uses_libraries))
$(call add_json_list, UsesLibraries, $(LOCAL_USES_LIBRARIES))
$(call add_json_map, LibraryPaths)
- $(foreach lib,$(sort $(LOCAL_USES_LIBRARIES) $(LOCAL_OPTIONAL_USES_LIBRARIES) org.apache.http.legacy android.hidl.base-V1.0-java android.hidl.manager-V1.0-java),\
+ $(foreach lib,$(my_dexpreopt_libs),\
$(call add_json_str, $(lib), $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar))
$(call end_json_map)
$(call add_json_list, Archs, $(my_dexpreopt_archs))
@@ -256,7 +261,7 @@
my_dexpreopt_deps := $(my_dex_jar)
my_dexpreopt_deps += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE))
my_dexpreopt_deps += \
- $(foreach lib,$(sort $(LOCAL_USES_LIBRARIES) $(LOCAL_OPTIONAL_USES_LIBRARIES) org.apache.http.legacy android.hidl.base-V1.0-java android.hidl.manager-V1.0-java),\
+ $(foreach lib, $(my_dexpreopt_libs), \
$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/javalib.jar)
my_dexpreopt_deps += $(my_dexpreopt_images)
my_dexpreopt_deps += $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)
diff --git a/core/dumpvar.mk b/core/dumpvar.mk
index 2f1023f..b2ee8fd 100644
--- a/core/dumpvar.mk
+++ b/core/dumpvar.mk
@@ -27,6 +27,6 @@
.PHONY: dump-many-vars
dump-many-vars :
@$(foreach v, $(DUMP_MANY_VARS),\
- echo "$(DUMP_VAR_PREFIX)$(v)='$($(v))'";)
+ printf "%s='%s'\n" '$(DUMP_VAR_PREFIX)$(v)' '$($(v))';)
endif # CALLED_FROM_SETUP
diff --git a/core/host_java_library.mk b/core/host_java_library.mk
index 1225fa9..a29a1b8 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -52,6 +52,8 @@
$(filter %.java,$(LOCAL_GENERATED_SOURCES))
all_java_sources := $(java_sources)
+ALL_MODULES.$(my_register_name).SRCS := $(ALL_MODULES.$(my_register_name).SRCS) $(all_java_sources)
+
include $(BUILD_SYSTEM)/java_common.mk
# The layers file allows you to enforce a layering between java packages.
diff --git a/core/main.mk b/core/main.mk
index 94bfd4b..5cb1d34 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1327,15 +1327,18 @@
ifeq (true,$(PRODUCT_ENFORCE_PACKAGES_EXIST))
_whitelist := $(PRODUCT_ENFORCE_PACKAGES_EXIST_WHITELIST)
_modules := $(PRODUCT_PACKAGES)
+ # Strip :32 and :64 suffixes
+ _modules := $(patsubst %:32,%,$(_modules))
+ _modules := $(patsubst %:64,%,$(_modules))
# Sanity check all modules in PRODUCT_PACKAGES exist. We check for the
# existence if either <module> or the <module>_32 variant.
- _nonexistant_modules := $(filter-out $(ALL_MODULES),$(_modules))
- _nonexistant_modules := $(foreach m,$(_nonexistant_modules),\
+ _nonexistent_modules := $(filter-out $(ALL_MODULES),$(_modules))
+ _nonexistent_modules := $(foreach m,$(_nonexistent_modules),\
$(if $(call get-32-bit-modules,$(m)),,$(m)))
- $(call maybe-print-list-and-error,$(filter-out $(_whitelist),$(_nonexistant_modules)),\
- $(INTERNAL_PRODUCT) includes non-existant modules in PRODUCT_PACKAGES)
- $(call maybe-print-list-and-error,$(filter-out $(_nonexistant_modules),$(_whitelist)),\
- $(INTERNAL_PRODUCT) includes redundant whitelist entries for nonexistant PRODUCT_PACKAGES)
+ $(call maybe-print-list-and-error,$(filter-out $(_whitelist),$(_nonexistent_modules)),\
+ $(INTERNAL_PRODUCT) includes non-existent modules in PRODUCT_PACKAGES)
+ $(call maybe-print-list-and-error,$(filter-out $(_nonexistent_modules),$(_whitelist)),\
+ $(INTERNAL_PRODUCT) includes redundant whitelist entries for nonexistent PRODUCT_PACKAGES)
endif
# Check to ensure that all modules in PRODUCT_HOST_PACKAGES exist
@@ -1344,10 +1347,13 @@
# maybe it would make sense to have PRODUCT_HOST_PACKAGES_LINUX/_DARWIN?
ifneq ($(HOST_OS),darwin)
_modules := $(PRODUCT_HOST_PACKAGES)
- _nonexistant_modules := $(foreach m,$(_modules),\
+ # Strip :32 and :64 suffixes
+ _modules := $(patsubst %:32,%,$(_modules))
+ _modules := $(patsubst %:64,%,$(_modules))
+ _nonexistent_modules := $(foreach m,$(_modules),\
$(if $(ALL_MODULES.$(m).REQUIRED_FROM_HOST)$(filter $(HOST_OUT_ROOT)/%,$(ALL_MODULES.$(m).INSTALLED)),,$(m)))
- $(call maybe-print-list-and-error,$(_nonexistant_modules),\
- $(INTERNAL_PRODUCT) includes non-existant modules in PRODUCT_HOST_PACKAGES)
+ $(call maybe-print-list-and-error,$(_nonexistent_modules),\
+ $(INTERNAL_PRODUCT) includes non-existent modules in PRODUCT_HOST_PACKAGES)
endif
endif
@@ -1450,7 +1456,6 @@
$(ALL_DEFAULT_INSTALLED_MODULES) \
$(product_target_FILES) \
$(product_host_FILES) \
- $(call get-tagged-modules,$(tags_to_install)) \
$(CUSTOM_MODULES) \
)
@@ -1613,6 +1618,7 @@
$(INSTALLED_SYSTEMIMAGE_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_BOOTIMAGE_TARGET) \
+ $(INSTALLED_RADIOIMAGE_TARGET) \
$(INSTALLED_DEBUG_RAMDISK_TARGET) \
$(INSTALLED_DEBUG_BOOTIMAGE_TARGET) \
$(INSTALLED_RECOVERYIMAGE_TARGET) \
diff --git a/core/notice_files.mk b/core/notice_files.mk
index c314734..6df570e 100644
--- a/core/notice_files.mk
+++ b/core/notice_files.mk
@@ -61,6 +61,9 @@
# device-obj or host-obj.
module_installed_filename := \
$(patsubst $(PRODUCT_OUT)/%,%,$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_SHARED_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE))
+ else ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
+ # Shared modules may be uninstallable(e.g. TARGET_SKIP_CURRENT_VNDK=true)
+ module_installed_filename :=
else
ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
# Stick the static java libraries with the regular java libraries.
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 493a0f1..fcaf947 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -25,18 +25,6 @@
## be set for you.
###########################################################
-# If this makefile is being read from within an inheritance,
-# use the new values.
-skip_definition:=
-ifdef LOCAL_PACKAGE_OVERRIDES
- package_overridden := $(call set-inherited-package-variables)
- ifeq ($(strip $(package_overridden)),)
- skip_definition := true
- endif
-endif
-
-ifndef skip_definition
-
LOCAL_PACKAGE_NAME := $(strip $(LOCAL_PACKAGE_NAME))
ifeq ($(LOCAL_PACKAGE_NAME),)
$(error $(LOCAL_PATH): Package modules must define LOCAL_PACKAGE_NAME)
@@ -483,6 +471,31 @@
$(LOCAL_BUILT_MODULE): $(additional_certificates)
$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(additional_certificates)
+# Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES
+# If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or
+# LOCAL_OPTIONAL_USES_LIBRARIES are specified.
+# Will change the default to true unconditionally in the future.
+ifndef LOCAL_ENFORCE_USES_LIBRARIES
+ ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES)))
+ LOCAL_ENFORCE_USES_LIBRARIES := true
+ endif
+endif
+
+my_enforced_uses_libraries :=
+ifdef LOCAL_ENFORCE_USES_LIBRARIES
+ my_manifest_check := $(intermediates.COMMON)/manifest/AndroidManifest.xml.check
+ $(my_manifest_check): $(MANIFEST_CHECK)
+ $(my_manifest_check): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES)
+ $(my_manifest_check): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES)
+ $(my_manifest_check): $(full_android_manifest)
+ @echo Checking manifest: $<
+ $(MANIFEST_CHECK) --enforce-uses-libraries \
+ $(addprefix --uses-library ,$(PRIVATE_USES_LIBRARIES)) \
+ $(addprefix --optional-uses-library ,$(PRIVATE_OPTIONAL_USES_LIBRARIES)) \
+ $< -o $@
+ $(LOCAL_BUILT_MODULE): $(my_manifest_check)
+endif
+
# Define the rule to build the actual package.
# PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>.
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis)
@@ -524,7 +537,7 @@
$(LOCAL_BUILT_MODULE) : $(jni_shared_libraries)
$(LOCAL_BUILT_MODULE) : $(JAR_ARGS) $(SOONG_ZIP) $(MERGE_ZIPS) $(ZIP2ZIP)
$(LOCAL_BUILT_MODULE): PRIVATE_RES_PACKAGE := $(my_res_package)
-$(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2) | $(ACP)
+$(LOCAL_BUILT_MODULE) : $(my_res_package) $(AAPT2)
ifdef LOCAL_COMPRESSED_MODULE
$(LOCAL_BUILT_MODULE) : $(MINIGZIP)
endif
@@ -692,8 +705,6 @@
PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME)
-endif # skip_definition
-
# Reset internal variables.
all_res_assets :=
diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk
index 7a8f46e..55dd077 100644
--- a/core/soong_cc_prebuilt.mk
+++ b/core/soong_cc_prebuilt.mk
@@ -3,6 +3,7 @@
# LOCAL_SOONG_LINK_TYPE
# LOCAL_SOONG_TOC
# LOCAL_SOONG_UNSTRIPPED_BINARY
+# LOCAL_SOONG_VNDK_VERSION : means the version of VNDK where this module belongs
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
$(call pretty-error,soong_cc_prebuilt.mk may only be used from Soong)
@@ -51,6 +52,13 @@
endif
endif
+# Don't install modules of current VNDK when it is told so
+ifeq ($(TARGET_SKIP_CURRENT_VNDK),true)
+ ifeq ($(LOCAL_SOONG_VNDK_VERSION),$(PLATFORM_VNDK_VERSION))
+ LOCAL_UNINSTALLABLE_MODULE := true
+ endif
+endif
+
#######################################
include $(BUILD_SYSTEM)/base_rules.mk
#######################################
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 220e2c8..ac3cfb3 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -156,7 +156,7 @@
$(call add_json_list, PgoAdditionalProfileDirs, $(PGO_ADDITIONAL_PROFILE_DIRS))
-$(call add_json_list, BoardVendorSepolicyDirs, $(BOARD_SEPOLICY_DIRS))
+$(call add_json_list, BoardVendorSepolicyDirs, $(BOARD_VENDOR_SEPOLICY_DIRS) $(BOARD_SEPOLICY_DIRS))
$(call add_json_list, BoardOdmSepolicyDirs, $(BOARD_ODM_SEPOLICY_DIRS))
$(call add_json_list, BoardPlatPublicSepolicyDirs, $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))
$(call add_json_list, BoardPlatPrivateSepolicyDirs, $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
@@ -183,6 +183,8 @@
$(call add_json_list, TargetFSConfigGen, $(TARGET_FS_CONFIG_GEN))
+$(call add_json_list, MissingUsesLibraries, $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES))
+
$(call add_json_map, VendorVars)
$(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\
$(call add_json_map, $(namespace))\
diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk
index 93db1de..62d9aa6 100644
--- a/core/tasks/sdk-addon.mk
+++ b/core/tasks/sdk-addon.mk
@@ -114,20 +114,20 @@
$(full_target): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_leaf))
-$(full_target): $(sdk_addon_deps) | $(ACP) $(SOONG_ZIP)
+$(full_target): $(sdk_addon_deps) | $(SOONG_ZIP)
@echo Packaging SDK Addon: $@
$(hide) mkdir -p $(PRIVATE_STAGING_DIR)/docs
$(hide) for d in $(PRIVATE_DOCS_DIRS); do \
- $(ACP) -r $$d $(PRIVATE_STAGING_DIR)/docs ;\
+ cp -R $$d $(PRIVATE_STAGING_DIR)/docs ;\
done
$(hide) mkdir -p $(dir $@)
$(hide) $(SOONG_ZIP) -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR)
$(full_target_img): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_img))/images/$(TARGET_CPU_ABI)
-$(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) $(SOONG_ZIP)
+$(full_target_img): $(full_target) $(addon_img_source_prop) | $(SOONG_ZIP)
@echo Packaging SDK Addon System-Image: $@
$(hide) mkdir -p $(dir $@)
- $(ACP) -r $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data
+ cp -R $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data
$(hide) $(SOONG_ZIP) -o $@ -C $(dir $(PRIVATE_STAGING_DIR)) -D $(PRIVATE_STAGING_DIR)
diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk
index 57a5cf9..f480300 100644
--- a/core/tasks/tools/compatibility.mk
+++ b/core/tasks/tools/compatibility.mk
@@ -53,8 +53,8 @@
$(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
$(hide) echo $(BUILD_NUMBER_FROM_FILE) > $(PRIVATE_OUT_DIR)/tools/version.txt
# Copy tools
- $(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
- $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) $(ACP) -fp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
+ $(hide) cp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
+ $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) cp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
$(hide) find $(dir $@)/$(PRIVATE_NAME) | sort >$@.list
$(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@) -l $@.list
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 2714f83..62c91f8 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -73,11 +73,6 @@
# Update this value when the platform version changes (rather
# than overriding it somewhere else). Can be an arbitrary string.
-# When you add a new PLATFORM_VERSION which will result in a new
-# PLATFORM_SDK_VERSION please ensure you add a corresponding isAtLeast*
-# method in the following java file:
-# frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java
-
# When you change PLATFORM_VERSION for a given PLATFORM_SDK_VERSION
# please add that PLATFORM_VERSION as well as clean up obsolete PLATFORM_VERSION's
# in the following text file:
@@ -116,10 +111,6 @@
# SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
# the code-name of the new development work.
- # When you change PLATFORM_SDK_VERSION please ensure you also update the
- # corresponding methods for isAtLeast* in the following java file:
- # frameworks/support/compat/gingerbread/android/support/v4/os/BuildCompat.java
-
# When you increment the PLATFORM_SDK_VERSION please ensure you also
# clear out the following text file of all older PLATFORM_VERSION's:
# cts/tests/tests/os/assets/platform_versions.txt
diff --git a/target/board/BoardConfigMainlineCommon.mk b/target/board/BoardConfigMainlineCommon.mk
index be7c804..be014bf 100644
--- a/target/board/BoardConfigMainlineCommon.mk
+++ b/target/board/BoardConfigMainlineCommon.mk
@@ -41,3 +41,6 @@
# Generate an APEX image for experiment b/119800099.
DEXPREOPT_GENERATE_APEX_IMAGE := true
+
+# Mainline devices support apex
+TARGET_FLATTEN_APEX := false
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index c45f870..bb39cd9 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -49,6 +49,7 @@
gralloc.default \
group \
init_vendor \
+ libashmemd_hidl_client \
libbundlewrapper \
libclearkeycasplugin \
libdownmix \
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index eaaa051..5693234 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -46,6 +46,8 @@
# b/118634643: don't check VNDK lib list when building PDK. Some libs (libandroid_net.so
# and some render-script related ones) can't be built in PDK due to missing frameworks/base.
check-vndk-list: ;
+else ifeq ($(TARGET_SKIP_CURRENT_VNDK),true)
+check-vndk-list: ;
else
check-vndk-list: $(check-vndk-list-timestamp)
endif
@@ -100,11 +102,11 @@
include $(CLEAR_VARS)
LOCAL_MODULE := vndk_package
LOCAL_REQUIRED_MODULES := \
- $(LLNDK_LIBRARIES) \
- llndk.libraries.txt \
- vndksp.libraries.txt
+ $(LLNDK_LIBRARIES)
ifneq ($(TARGET_SKIP_CURRENT_VNDK),true)
LOCAL_REQUIRED_MODULES += \
+ llndk.libraries.txt \
+ vndksp.libraries.txt \
$(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) \
$(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES))
endif
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index 584a0ca..e936d45 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -169,6 +169,7 @@
VNDK-core: android.hidl.memory.block@1.0.so
VNDK-core: android.hidl.token@1.0.so
VNDK-core: android.hidl.token@1.0-utils.so
+VNDK-core: android.system.ashmem@1.0.so
VNDK-core: android.system.net.netd@1.0.so
VNDK-core: android.system.net.netd@1.1.so
VNDK-core: android.system.suspend@1.0.so
diff --git a/tools/fs_config/Android.mk b/tools/fs_config/Android.mk
index 96db0f3..af0da46 100644
--- a/tools/fs_config/Android.mk
+++ b/tools/fs_config/Android.mk
@@ -99,7 +99,7 @@
--aid-header $(PRIVATE_ANDROID_FS_HDR) \
--capability-header $(PRIVATE_ANDROID_CAP_HDR) \
--partition system \
- --all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \
+ --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
--dirs \
--out_file $@ \
$(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
@@ -124,7 +124,7 @@
--aid-header $(PRIVATE_ANDROID_FS_HDR) \
--capability-header $(PRIVATE_ANDROID_CAP_HDR) \
--partition system \
- --all-partitions $(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST)) \
+ --all-partitions "$(subst $(space),$(comma),$(PRIVATE_PARTITION_LIST))" \
--files \
--out_file $@ \
$(or $(PRIVATE_TARGET_FS_CONFIG_GEN),/dev/null)
diff --git a/tools/fs_config/fs_config_generator.py b/tools/fs_config/fs_config_generator.py
index dccff92..4400466 100755
--- a/tools/fs_config/fs_config_generator.py
+++ b/tools/fs_config/fs_config_generator.py
@@ -1004,10 +1004,6 @@
self._partition = args['partition']
self._all_partitions = args['all_partitions']
- if self._partition == 'system' and self._all_partitions is None:
- sys.exit(
- 'All other partitions must be provided if generating output'
- ' for the system partition')
self._out_file = args['out_file']
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index 4156c8b..ebaa867 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -28,7 +28,8 @@
-r (--rebuild_recovery)
Rebuild the recovery patch and write it to the system image. Only
- meaningful when system image needs to be rebuilt.
+ meaningful when system image needs to be rebuilt and there're separate
+ boot / recovery images.
--replace_verity_private_key
Replace the private key used for verity signing. (same as the option
@@ -164,7 +165,8 @@
else:
common.ZipWrite(output_zip, ofile.name, arc_name)
- if OPTIONS.rebuild_recovery:
+ if (OPTIONS.rebuild_recovery and recovery_img is not None and
+ boot_img is not None):
logger.info("Building new recovery patch")
common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink, recovery_img,
boot_img, info_dict=OPTIONS.info_dict)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 9d67c49..80f8002 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -99,6 +99,9 @@
AVB_PARTITIONS = ('boot', 'dtbo', 'odm', 'product', 'product_services',
'recovery', 'system', 'vendor')
+# Chained VBMeta partitions.
+AVB_VBMETA_PARTITIONS = ('vbmeta_system', 'vbmeta_vendor')
+
# Partitions that should have their care_map added to META/care_map.pb
PARTITIONS_WITH_CARE_MAP = ('system', 'vendor', 'product', 'product_services',
'odm')
diff --git a/tools/releasetools/merge_target_files.py b/tools/releasetools/merge_target_files.py
index e8c3cf7..f37c0ee 100755
--- a/tools/releasetools/merge_target_files.py
+++ b/tools/releasetools/merge_target_files.py
@@ -15,31 +15,31 @@
# the License.
"""This script merges two partial target files packages.
-One package contains system files, and the other contains non-system files.
+One package contains framework files, and the other contains vendor files.
It produces a complete target files package that can be used to generate an
OTA package.
Usage: merge_target_files.py [args]
- --system-target-files system-target-files-zip-archive
- The input target files package containing system bits. This is a zip
+ --framework-target-files framework-target-files-zip-archive
+ The input target files package containing framework bits. This is a zip
archive.
- --system-item-list system-item-list-file
+ --framework-item-list framework-item-list-file
The optional path to a newline-separated config file that replaces the
- contents of default_system_item_list if provided.
+ contents of DEFAULT_FRAMEWORK_ITEM_LIST if provided.
- --system-misc-info-keys system-misc-info-keys-file
+ --framework-misc-info-keys framework-misc-info-keys-file
The optional path to a newline-separated config file that replaces the
- contents of default_system_misc_info_keys if provided.
+ contents of DEFAULT_FRAMEWORK_MISC_INFO_KEYS if provided.
- --other-target-files other-target-files-zip-archive
- The input target files package containing other bits. This is a zip
+ --vendor-target-files vendor-target-files-zip-archive
+ The input target files package containing vendor bits. This is a zip
archive.
- --other-item-list other-item-list-file
+ --vendor-item-list vendor-item-list-file
The optional path to a newline-separated config file that replaces the
- contents of default_other_item_list if provided.
+ contents of DEFAULT_VENDOR_ITEM_LIST if provided.
--output-target-files output-target-files-package
If provided, the output merged target files package. Also a zip archive.
@@ -93,11 +93,11 @@
logger = logging.getLogger(__name__)
OPTIONS = common.OPTIONS
OPTIONS.verbose = True
-OPTIONS.system_target_files = None
-OPTIONS.system_item_list = None
-OPTIONS.system_misc_info_keys = None
-OPTIONS.other_target_files = None
-OPTIONS.other_item_list = None
+OPTIONS.framework_target_files = None
+OPTIONS.framework_item_list = None
+OPTIONS.framework_misc_info_keys = None
+OPTIONS.vendor_target_files = None
+OPTIONS.vendor_item_list = None
OPTIONS.output_target_files = None
OPTIONS.output_dir = None
OPTIONS.output_item_list = None
@@ -107,12 +107,12 @@
OPTIONS.rebuild_recovery = False
OPTIONS.keep_tmp = False
-# default_system_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
+# DEFAULT_FRAMEWORK_ITEM_LIST is a list of items to extract from the partial
+# framework target files package as is, meaning these items will land in the
# output target files package exactly as they appear in the input partial
-# system target files package.
+# framework target files package.
-default_system_item_list = [
+DEFAULT_FRAMEWORK_ITEM_LIST = (
'META/apkcerts.txt',
'META/filesystem_config.txt',
'META/root_filesystem_config.txt',
@@ -122,21 +122,20 @@
'PRODUCT/*',
'ROOT/*',
'SYSTEM/*',
-]
+)
-# system_extract_special_item_list is a list of items to extract from the
-# partial system target files package that need some special processing, such
-# as some sort of combination with items from the partial other target files
+# FRAMEWORK_EXTRACT_SPECIAL_ITEM_LIST is a list of items to extract from the
+# partial framework target files package that need some special processing, such
+# as some sort of combination with items from the partial vendor target files
# package.
-system_extract_special_item_list = [
- 'META/*',
-]
+FRAMEWORK_EXTRACT_SPECIAL_ITEM_LIST = ('META/*',)
-# default_system_misc_info_keys is a list of keys to obtain from the system
-# instance of META/misc_info.txt. The remaining keys from the other instance.
+# DEFAULT_FRAMEWORK_MISC_INFO_KEYS is a list of keys to obtain from the
+# framework instance of META/misc_info.txt. The remaining keys from the
+# vendor instance.
-default_system_misc_info_keys = [
+DEFAULT_FRAMEWORK_MISC_INFO_KEYS = (
'avb_system_hashtree_enable',
'avb_system_add_hashtree_footer_args',
'avb_system_key_path',
@@ -151,14 +150,14 @@
'ab_update',
'default_system_dev_certificate',
'system_size',
-]
+)
-# default_other_item_list is a list of items to extract from the partial
-# other target files package as is, meaning these items will land in the output
-# target files package exactly as they appear in the input partial other target
+# DEFAULT_VENDOR_ITEM_LIST is a list of items to extract from the partial
+# vendor target files package as is, meaning these items will land in the output
+# target files package exactly as they appear in the input partial vendor target
# files package.
-default_other_item_list = [
+DEFAULT_VENDOR_ITEM_LIST = (
'META/boot_filesystem_config.txt',
'META/otakeys.txt',
'META/releasetools.py',
@@ -172,16 +171,33 @@
'PREBUILT_IMAGES/*',
'RADIO/*',
'VENDOR/*',
-]
+)
-# other_extract_special_item_list is a list of items to extract from the
-# partial other target files package that need some special processing, such as
-# some sort of combination with items from the partial system target files
+# VENDOR_EXTRACT_SPECIAL_ITEM_LIST is a list of items to extract from the
+# partial vendor target files package that need some special processing, such as
+# some sort of combination with items from the partial framework target files
# package.
-other_extract_special_item_list = [
- 'META/*',
-]
+VENDOR_EXTRACT_SPECIAL_ITEM_LIST = ('META/*',)
+
+# The merge config lists should not attempt to extract items from both
+# builds for any of the following partitions. The partitions in
+# SINGLE_BUILD_PARTITIONS should come entirely from a single build (either
+# framework or vendor, but not both).
+
+SINGLE_BUILD_PARTITIONS = (
+ 'BOOT/',
+ 'DATA/',
+ 'ODM/',
+ 'PRODUCT/',
+ 'PRODUCT_SERVICES/',
+ 'RADIO/',
+ 'RECOVERY/',
+ 'ROOT/',
+ 'SYSTEM/',
+ 'SYSTEM_OTHER/',
+ 'VENDOR/',
+)
def write_sorted_data(data, path):
@@ -196,9 +212,7 @@
be overridden if it exists.
"""
with open(path, 'w') as output:
- sorted_data = sorted(data.keys()) if isinstance(data,
- dict) else sorted(data)
- for entry in sorted_data:
+ for entry in sorted(data):
out_str = '{}={}\n'.format(entry, data[entry]) if isinstance(
data, dict) else '{}\n'.format(entry)
output.write(out_str)
@@ -280,26 +294,29 @@
return config_file.read().splitlines()
-def validate_config_lists(system_item_list, system_misc_info_keys,
- other_item_list):
+def validate_config_lists(framework_item_list, framework_misc_info_keys,
+ vendor_item_list):
"""Performs validations on the merge config lists.
Args:
- system_item_list: The list of items to extract from the partial system
+ framework_item_list: The list of items to extract from the partial framework
target files package as is.
- system_misc_info_keys: A list of keys to obtain from the system instance of
- META/misc_info.txt. The remaining keys from the other instance.
- other_item_list: The list of items to extract from the partial other target
- files package as is.
+ framework_misc_info_keys: A list of keys to obtain from the framework
+ instance of META/misc_info.txt. The remaining keys from the vendor
+ instance.
+ vendor_item_list: The list of items to extract from the partial vendor
+ target files package as is.
Returns:
False if a validation fails, otherwise true.
"""
- default_combined_item_set = set(default_system_item_list)
- default_combined_item_set.update(default_other_item_list)
+ has_error = False
- combined_item_set = set(system_item_list)
- combined_item_set.update(other_item_list)
+ default_combined_item_set = set(DEFAULT_FRAMEWORK_ITEM_LIST)
+ default_combined_item_set.update(DEFAULT_VENDOR_ITEM_LIST)
+
+ combined_item_set = set(framework_item_list)
+ combined_item_set.update(vendor_item_list)
# Check that the merge config lists are not missing any item specified
# by the default config lists.
@@ -307,26 +324,37 @@
if difference:
logger.error('Missing merge config items: %s', list(difference))
logger.error('Please ensure missing items are in either the '
- 'system-item-list or other-item-list files provided to '
+ 'framework-item-list or vendor-item-list files provided to '
'this script.')
- return False
+ has_error = True
- if ('dynamic_partition_list' in system_misc_info_keys) or (
- 'super_partition_groups' in system_misc_info_keys):
+ for partition in SINGLE_BUILD_PARTITIONS:
+ in_framework = any(
+ item.startswith(partition) for item in framework_item_list)
+ in_vendor = any(item.startswith(partition) for item in vendor_item_list)
+ if in_framework and in_vendor:
+ logger.error(
+ 'Cannot extract items from {0} for both the framework and vendor builds. '
+ 'Please ensure only one merge config item list includes {0}.'.format(
+ partition))
+ has_error = True
+
+ if ('dynamic_partition_list' in framework_misc_info_keys) or (
+ 'super_partition_groups' in framework_misc_info_keys):
logger.error('Dynamic partition misc info keys should come from '
- 'the other instance of META/misc_info.txt.')
- return False
+ 'the vendor instance of META/misc_info.txt.')
+ has_error = True
- return True
+ return not has_error
-def process_ab_partitions_txt(system_target_files_temp_dir,
- other_target_files_temp_dir,
+def process_ab_partitions_txt(framework_target_files_temp_dir,
+ vendor_target_files_temp_dir,
output_target_files_temp_dir):
"""Perform special processing for META/ab_partitions.txt.
This function merges the contents of the META/ab_partitions.txt files from
- the system directory and the other directory, placing the merged result in
+ the framework directory and the vendor directory, placing the merged result in
the output directory. The precondition in that the files are already
extracted. The post condition is that the output META/ab_partitions.txt
contains the merged content. The format for each ab_partitions.txt a one
@@ -334,28 +362,28 @@
names.
Args:
- system_target_files_temp_dir: The name of a directory containing the special
- items extracted from the system target files package.
- other_target_files_temp_dir: The name of a directory containing the special
- items extracted from the other target files package.
+ framework_target_files_temp_dir: The name of a directory containing the
+ special items extracted from the framework target files package.
+ vendor_target_files_temp_dir: The name of a directory containing the special
+ items extracted from the vendor target files package.
output_target_files_temp_dir: The name of a directory that will be used to
create the output target files package after all the special cases are
processed.
"""
- system_ab_partitions_txt = os.path.join(system_target_files_temp_dir, 'META',
+ framework_ab_partitions_txt = os.path.join(framework_target_files_temp_dir,
+ 'META', 'ab_partitions.txt')
+
+ vendor_ab_partitions_txt = os.path.join(vendor_target_files_temp_dir, 'META',
'ab_partitions.txt')
- other_ab_partitions_txt = os.path.join(other_target_files_temp_dir, 'META',
- 'ab_partitions.txt')
+ with open(framework_ab_partitions_txt) as f:
+ framework_ab_partitions = f.read().splitlines()
- with open(system_ab_partitions_txt) as f:
- system_ab_partitions = f.read().splitlines()
+ with open(vendor_ab_partitions_txt) as f:
+ vendor_ab_partitions = f.read().splitlines()
- with open(other_ab_partitions_txt) as f:
- other_ab_partitions = f.read().splitlines()
-
- output_ab_partitions = set(system_ab_partitions + other_ab_partitions)
+ output_ab_partitions = set(framework_ab_partitions + vendor_ab_partitions)
output_ab_partitions_txt = os.path.join(output_target_files_temp_dir, 'META',
'ab_partitions.txt')
@@ -389,8 +417,8 @@
'selabel=u:object_r:install_recovery_exec:s0 capabilities=0x0\n')
-def merge_dynamic_partition_info_dicts(system_dict,
- other_dict,
+def merge_dynamic_partition_info_dicts(framework_dict,
+ vendor_dict,
include_dynamic_partition_list=True,
size_prefix='',
size_suffix='',
@@ -399,10 +427,10 @@
"""Merges dynamic partition info variables.
Args:
- system_dict: The dictionary of dynamic partition info variables from the
- partial system target files.
- other_dict: The dictionary of dynamic partition info variables from the
- partial other target files.
+ framework_dict: The dictionary of dynamic partition info variables from the
+ partial framework target files.
+ vendor_dict: The dictionary of dynamic partition info variables from the
+ partial vendor target files.
include_dynamic_partition_list: If true, merges the dynamic_partition_list
variable. Not all use cases need this variable merged.
size_prefix: The prefix in partition group size variables that precedes the
@@ -420,53 +448,56 @@
The merged dynamic partition info dictionary.
"""
merged_dict = {}
- # Partition groups and group sizes are defined by the other (non-system)
- # dict because these values may vary for each board that uses a shared system
- # image.
- merged_dict['super_partition_groups'] = other_dict['super_partition_groups']
+ # Partition groups and group sizes are defined by the vendor dict because
+ # these values may vary for each board that uses a shared system image.
+ merged_dict['super_partition_groups'] = vendor_dict['super_partition_groups']
if include_dynamic_partition_list:
- system_dynamic_partition_list = system_dict.get('dynamic_partition_list',
+ framework_dynamic_partition_list = framework_dict.get(
+ 'dynamic_partition_list', '')
+ vendor_dynamic_partition_list = vendor_dict.get('dynamic_partition_list',
'')
- other_dynamic_partition_list = other_dict.get('dynamic_partition_list', '')
merged_dict['dynamic_partition_list'] = (
- '%s %s' %
- (system_dynamic_partition_list, other_dynamic_partition_list)).strip()
+ '%s %s' % (framework_dynamic_partition_list,
+ vendor_dynamic_partition_list)).strip()
for partition_group in merged_dict['super_partition_groups'].split(' '):
- # Set the partition group's size using the value from the other dict.
+ # Set the partition group's size using the value from the vendor dict.
key = '%s%s%s' % (size_prefix, partition_group, size_suffix)
- if key not in other_dict:
- raise ValueError('Other dict does not contain required key %s.' % key)
- merged_dict[key] = other_dict[key]
+ if key not in vendor_dict:
+ raise ValueError('Vendor dict does not contain required key %s.' % key)
+ merged_dict[key] = vendor_dict[key]
# Set the partition group's partition list using a concatenation of the
- # system and other partition lists.
+ # framework and vendor partition lists.
key = '%s%s%s' % (list_prefix, partition_group, list_suffix)
merged_dict[key] = (
- '%s %s' % (system_dict.get(key, ''), other_dict.get(key, ''))).strip()
+ '%s %s' %
+ (framework_dict.get(key, ''), vendor_dict.get(key, ''))).strip()
return merged_dict
-def process_misc_info_txt(system_target_files_temp_dir,
- other_target_files_temp_dir,
- output_target_files_temp_dir, system_misc_info_keys):
+def process_misc_info_txt(framework_target_files_temp_dir,
+ vendor_target_files_temp_dir,
+ output_target_files_temp_dir,
+ framework_misc_info_keys):
"""Perform special processing for META/misc_info.txt.
This function merges the contents of the META/misc_info.txt files from the
- system directory and the other directory, placing the merged result in the
+ framework directory and the vendor directory, placing the merged result in the
output directory. The precondition in that the files are already extracted.
The post condition is that the output META/misc_info.txt contains the merged
content.
Args:
- system_target_files_temp_dir: The name of a directory containing the special
- items extracted from the system target files package.
- other_target_files_temp_dir: The name of a directory containing the special
- items extracted from the other target files package.
+ framework_target_files_temp_dir: The name of a directory containing the
+ special items extracted from the framework target files package.
+ vendor_target_files_temp_dir: The name of a directory containing the special
+ items extracted from the vendor target files package.
output_target_files_temp_dir: The name of a directory that will be used to
create the output target files package after all the special cases are
processed.
- system_misc_info_keys: A list of keys to obtain from the system instance of
- META/misc_info.txt. The remaining keys from the other instance.
+ framework_misc_info_keys: A list of keys to obtain from the framework
+ instance of META/misc_info.txt. The remaining keys from the vendor
+ instance.
"""
def read_helper(d):
@@ -474,72 +505,72 @@
with open(misc_info_txt) as f:
return list(f.read().splitlines())
- system_info_dict = common.LoadDictionaryFromLines(
- read_helper(system_target_files_temp_dir))
+ framework_dict = common.LoadDictionaryFromLines(
+ read_helper(framework_target_files_temp_dir))
- # We take most of the misc info from the other target files.
+ # We take most of the misc info from the vendor target files.
- merged_info_dict = common.LoadDictionaryFromLines(
- read_helper(other_target_files_temp_dir))
+ merged_dict = common.LoadDictionaryFromLines(
+ read_helper(vendor_target_files_temp_dir))
- # Replace certain values in merged_info_dict with values from
- # system_info_dict.
+ # Replace certain values in merged_dict with values from
+ # framework_dict.
- for key in system_misc_info_keys:
- merged_info_dict[key] = system_info_dict[key]
+ for key in framework_misc_info_keys:
+ merged_dict[key] = framework_dict[key]
# Merge misc info keys used for Dynamic Partitions.
- if (merged_info_dict.get('use_dynamic_partitions') == 'true') and (
- system_info_dict.get('use_dynamic_partitions') == 'true'):
+ if (merged_dict.get('use_dynamic_partitions') == 'true') and (
+ framework_dict.get('use_dynamic_partitions') == 'true'):
merged_dynamic_partitions_dict = merge_dynamic_partition_info_dicts(
- system_dict=system_info_dict,
- other_dict=merged_info_dict,
+ framework_dict=framework_dict,
+ vendor_dict=merged_dict,
size_prefix='super_',
size_suffix='_group_size',
list_prefix='super_',
list_suffix='_partition_list')
- merged_info_dict.update(merged_dynamic_partitions_dict)
+ merged_dict.update(merged_dynamic_partitions_dict)
- # Replace <image>_selinux_fc values with system or other file_contexts.bin
+ # Replace <image>_selinux_fc values with framework or vendor file_contexts.bin
# depending on which dictionary the key came from.
# Only the file basename is required because all selinux_fc properties are
# replaced with the full path to the file under META/ when misc_info.txt is
# loaded from target files for repacking. See common.py LoadInfoDict().
- for key in merged_info_dict:
+ for key in merged_dict:
if key.endswith('_selinux_fc'):
- merged_info_dict[key] = 'other_file_contexts.bin'
- for key in system_info_dict:
+ merged_dict[key] = 'vendor_file_contexts.bin'
+ for key in framework_dict:
if key.endswith('_selinux_fc'):
- merged_info_dict[key] = 'system_file_contexts.bin'
+ merged_dict[key] = 'framework_file_contexts.bin'
output_misc_info_txt = os.path.join(output_target_files_temp_dir, 'META',
'misc_info.txt')
- write_sorted_data(data=merged_info_dict, path=output_misc_info_txt)
+ write_sorted_data(data=merged_dict, path=output_misc_info_txt)
-def process_dynamic_partitions_info_txt(system_target_files_dir,
- other_target_files_dir,
+def process_dynamic_partitions_info_txt(framework_target_files_dir,
+ vendor_target_files_dir,
output_target_files_dir):
"""Perform special processing for META/dynamic_partitions_info.txt.
This function merges the contents of the META/dynamic_partitions_info.txt
- files from the system directory and the other directory, placing the merged
- result in the output directory.
+ files from the framework directory and the vendor directory, placing the
+ merged result in the output directory.
- This function does nothing if META/dynamic_partitions_info.txt from the other
+ This function does nothing if META/dynamic_partitions_info.txt from the vendor
directory does not exist.
Args:
- system_target_files_dir: The name of a directory containing the special
- items extracted from the system target files package.
- other_target_files_dir: The name of a directory containing the special items
- extracted from the other target files package.
+ framework_target_files_dir: The name of a directory containing the special
+ items extracted from the framework target files package.
+ vendor_target_files_dir: The name of a directory containing the special
+ items extracted from the vendor target files package.
output_target_files_dir: The name of a directory that will be used to create
the output target files package after all the special cases are processed.
"""
if not os.path.exists(
- os.path.join(other_target_files_dir, 'META',
+ os.path.join(vendor_target_files_dir, 'META',
'dynamic_partitions_info.txt')):
return
@@ -549,14 +580,14 @@
with open(dynamic_partitions_info_txt) as f:
return list(f.read().splitlines())
- system_dynamic_partitions_dict = common.LoadDictionaryFromLines(
- read_helper(system_target_files_dir))
- other_dynamic_partitions_dict = common.LoadDictionaryFromLines(
- read_helper(other_target_files_dir))
+ framework_dynamic_partitions_dict = common.LoadDictionaryFromLines(
+ read_helper(framework_target_files_dir))
+ vendor_dynamic_partitions_dict = common.LoadDictionaryFromLines(
+ read_helper(vendor_target_files_dir))
merged_dynamic_partitions_dict = merge_dynamic_partition_info_dicts(
- system_dict=system_dynamic_partitions_dict,
- other_dict=other_dynamic_partitions_dict,
+ framework_dict=framework_dynamic_partitions_dict,
+ vendor_dict=vendor_dynamic_partitions_dict,
# META/dynamic_partitions_info.txt does not use dynamic_partition_list.
include_dynamic_partition_list=False,
size_suffix='_size',
@@ -569,24 +600,23 @@
path=output_dynamic_partitions_info_txt)
-def process_apex_keys_apk_certs_common(system_target_files_dir,
- other_target_files_dir,
+def process_apex_keys_apk_certs_common(framework_target_files_dir,
+ vendor_target_files_dir,
output_target_files_dir, file_name):
"""Perform special processing for META/apexkeys.txt or META/apkcerts.txt.
This function merges the contents of the META/apexkeys.txt or
- META/apkcerts.txt
- files from the system directory and the other directory, placing the merged
- result in the output directory. The precondition in that the files are already
- extracted.
- The post condition is that the output META/apexkeys.txt or META/apkcerts.txt
- contains the merged content.
+ META/apkcerts.txt files from the framework directory and the vendor
+ directory, placing the merged result in the output directory. The
+ precondition in that the files are already extracted. The post condition
+ is that the output META/apexkeys.txt or META/apkcerts.txt contains the
+ merged content.
Args:
- system_target_files_dir: The name of a directory containing the special
- items extracted from the system target files package.
- other_target_files_dir: The name of a directory containing the special items
- extracted from the other target files package.
+ framework_target_files_dir: The name of a directory containing the special
+ items extracted from the framework target files package.
+ vendor_target_files_dir: The name of a directory containing the special
+ items extracted from the vendor target files package.
output_target_files_dir: The name of a directory that will be used to create
the output target files package after all the special cases are processed.
file_name: The name of the file to merge. One of apkcerts.txt or
@@ -602,69 +632,75 @@
temp[line.split()[0]] = line.strip()
return temp
- system_dict = read_helper(system_target_files_dir)
- other_dict = read_helper(other_target_files_dir)
+ framework_dict = read_helper(framework_target_files_dir)
+ vendor_dict = read_helper(vendor_target_files_dir)
- for key in system_dict:
- if key in other_dict and other_dict[key] != system_dict[key]:
+ for key in framework_dict:
+ if key in vendor_dict and vendor_dict[key] != framework_dict[key]:
raise ValueError('Conflicting entries found in %s:\n %s and\n %s' %
- (file_name, system_dict[key], other_dict[key]))
- other_dict[key] = system_dict[key]
+ (file_name, framework_dict[key], vendor_dict[key]))
+ vendor_dict[key] = framework_dict[key]
output_file = os.path.join(output_target_files_dir, 'META', file_name)
- write_sorted_data(data=other_dict.values(), path=output_file)
+ write_sorted_data(data=vendor_dict.values(), path=output_file)
-def copy_file_contexts(system_target_files_dir, other_target_files_dir,
+def copy_file_contexts(framework_target_files_dir, vendor_target_files_dir,
output_target_files_dir):
"""Creates named copies of each build's file_contexts.bin in output META/."""
- system_fc_path = os.path.join(system_target_files_dir, 'META', 'system_file_contexts.bin')
- if not os.path.exists(system_fc_path):
- system_fc_path = os.path.join(system_target_files_dir, 'META', 'file_contexts.bin')
- if not os.path.exists(system_fc_path):
- raise ValueError('Missing system file_contexts.bin.')
+ framework_fc_path = os.path.join(framework_target_files_dir, 'META',
+ 'framework_file_contexts.bin')
+ if not os.path.exists(framework_fc_path):
+ framework_fc_path = os.path.join(framework_target_files_dir, 'META',
+ 'file_contexts.bin')
+ if not os.path.exists(framework_fc_path):
+ raise ValueError('Missing framework file_contexts.bin.')
shutil.copyfile(
- system_fc_path,
- os.path.join(output_target_files_dir, 'META', 'system_file_contexts.bin'))
+ framework_fc_path,
+ os.path.join(output_target_files_dir, 'META',
+ 'framework_file_contexts.bin'))
- other_fc_path = os.path.join(other_target_files_dir, 'META', 'other_file_contexts.bin')
- if not os.path.exists(other_fc_path):
- other_fc_path = os.path.join(other_target_files_dir, 'META', 'file_contexts.bin')
- if not os.path.exists(other_fc_path):
- raise ValueError('Missing other file_contexts.bin.')
+ vendor_fc_path = os.path.join(vendor_target_files_dir, 'META',
+ 'vendor_file_contexts.bin')
+ if not os.path.exists(vendor_fc_path):
+ vendor_fc_path = os.path.join(vendor_target_files_dir, 'META',
+ 'file_contexts.bin')
+ if not os.path.exists(vendor_fc_path):
+ raise ValueError('Missing vendor file_contexts.bin.')
shutil.copyfile(
- other_fc_path,
- os.path.join(output_target_files_dir, 'META', 'other_file_contexts.bin'))
+ vendor_fc_path,
+ os.path.join(output_target_files_dir, 'META', 'vendor_file_contexts.bin'))
-def process_special_cases(system_target_files_temp_dir,
- other_target_files_temp_dir,
- output_target_files_temp_dir, system_misc_info_keys,
- rebuild_recovery):
+def process_special_cases(framework_target_files_temp_dir,
+ vendor_target_files_temp_dir,
+ output_target_files_temp_dir,
+ framework_misc_info_keys, rebuild_recovery):
"""Perform special-case processing for certain target files items.
Certain files in the output target files package require special-case
processing. This function performs all that special-case processing.
Args:
- system_target_files_temp_dir: The name of a directory containing the special
- items extracted from the system target files package.
- other_target_files_temp_dir: The name of a directory containing the special
- items extracted from the other target files package.
+ framework_target_files_temp_dir: The name of a directory containing the
+ special items extracted from the framework target files package.
+ vendor_target_files_temp_dir: The name of a directory containing the special
+ items extracted from the vendor target files package.
output_target_files_temp_dir: The name of a directory that will be used to
create the output target files package after all the special cases are
processed.
- system_misc_info_keys: A list of keys to obtain from the system instance of
- META/misc_info.txt. The remaining keys from the other instance.
+ framework_misc_info_keys: A list of keys to obtain from the framework
+ instance of META/misc_info.txt. The remaining keys from the vendor
+ instance.
rebuild_recovery: If true, rebuild the recovery patch used by non-A/B
devices and write it to the system image.
"""
- if 'ab_update' in system_misc_info_keys:
+ if 'ab_update' in framework_misc_info_keys:
process_ab_partitions_txt(
- system_target_files_temp_dir=system_target_files_temp_dir,
- other_target_files_temp_dir=other_target_files_temp_dir,
+ framework_target_files_temp_dir=framework_target_files_temp_dir,
+ vendor_target_files_temp_dir=vendor_target_files_temp_dir,
output_target_files_temp_dir=output_target_files_temp_dir)
if rebuild_recovery:
@@ -672,65 +708,66 @@
output_target_files_temp_dir=output_target_files_temp_dir)
copy_file_contexts(
- system_target_files_dir=system_target_files_temp_dir,
- other_target_files_dir=other_target_files_temp_dir,
+ framework_target_files_dir=framework_target_files_temp_dir,
+ vendor_target_files_dir=vendor_target_files_temp_dir,
output_target_files_dir=output_target_files_temp_dir)
process_misc_info_txt(
- system_target_files_temp_dir=system_target_files_temp_dir,
- other_target_files_temp_dir=other_target_files_temp_dir,
+ framework_target_files_temp_dir=framework_target_files_temp_dir,
+ vendor_target_files_temp_dir=vendor_target_files_temp_dir,
output_target_files_temp_dir=output_target_files_temp_dir,
- system_misc_info_keys=system_misc_info_keys)
+ framework_misc_info_keys=framework_misc_info_keys)
process_dynamic_partitions_info_txt(
- system_target_files_dir=system_target_files_temp_dir,
- other_target_files_dir=other_target_files_temp_dir,
+ framework_target_files_dir=framework_target_files_temp_dir,
+ vendor_target_files_dir=vendor_target_files_temp_dir,
output_target_files_dir=output_target_files_temp_dir)
process_apex_keys_apk_certs_common(
- system_target_files_dir=system_target_files_temp_dir,
- other_target_files_dir=other_target_files_temp_dir,
+ framework_target_files_dir=framework_target_files_temp_dir,
+ vendor_target_files_dir=vendor_target_files_temp_dir,
output_target_files_dir=output_target_files_temp_dir,
file_name='apkcerts.txt')
process_apex_keys_apk_certs_common(
- system_target_files_dir=system_target_files_temp_dir,
- other_target_files_dir=other_target_files_temp_dir,
+ framework_target_files_dir=framework_target_files_temp_dir,
+ vendor_target_files_dir=vendor_target_files_temp_dir,
output_target_files_dir=output_target_files_temp_dir,
file_name='apexkeys.txt')
-def merge_target_files(temp_dir, system_target_files, system_item_list,
- system_misc_info_keys, other_target_files,
- other_item_list, output_target_files, output_dir,
+def merge_target_files(temp_dir, framework_target_files, framework_item_list,
+ framework_misc_info_keys, vendor_target_files,
+ vendor_item_list, output_target_files, output_dir,
output_item_list, output_ota, output_img,
output_super_empty, rebuild_recovery):
"""Merge two target files packages together.
- This function takes system and other target files packages as input, performs
- various file extractions, special case processing, and finally creates a
- merged zip archive as output.
+ This function takes framework and vendor target files packages as input,
+ performs various file extractions, special case processing, and finally
+ creates a merged zip archive as output.
Args:
temp_dir: The name of a directory we use when we extract items from the
input target files packages, and also a scratch directory that we use for
temporary files.
- system_target_files: The name of the zip archive containing the system
+ framework_target_files: The name of the zip archive containing the framework
partial target files package.
- system_item_list: The list of items to extract from the partial system
+ framework_item_list: The list of items to extract from the partial framework
target files package as is, meaning these items will land in the output
- target files package exactly as they appear in the input partial system
+ target files package exactly as they appear in the input partial framework
target files package.
- system_misc_info_keys: The list of keys to obtain from the system instance
- of META/misc_info.txt. The remaining keys from the other instance.
- other_target_files: The name of the zip archive containing the other partial
+ framework_misc_info_keys: The list of keys to obtain from the framework
+ instance of META/misc_info.txt. The remaining keys from the vendor
+ instance.
+ vendor_target_files: The name of the zip archive containing the vendor
+ partial target files package.
+ vendor_item_list: The list of items to extract from the partial vendor
+ target files package as is, meaning these items will land in the output
+ target files package exactly as they appear in the input partial vendor
target files package.
- other_item_list: The list of items to extract from the partial other target
- files package as is, meaning these items will land in the output target
- files package exactly as they appear in the input partial other target
- files package.
output_target_files: The name of the output zip archive target files package
- created by merging system and other.
+ created by merging framework and vendor.
output_dir: The destination directory for saving merged files.
output_item_list: The list of items to copy into the output_dir.
output_ota: The name of the output zip archive ota package.
@@ -741,51 +778,51 @@
devices and write it to the system image.
"""
- logger.info('starting: merge system %s and other %s into output %s',
- system_target_files, other_target_files, output_target_files)
+ logger.info('starting: merge framework %s and vendor %s into output %s',
+ framework_target_files, vendor_target_files, output_target_files)
- # Create directory names that we'll use when we extract files from system,
- # and other, and for zipping the final output.
+ # Create directory names that we'll use when we extract files from framework,
+ # and vendor, and for zipping the final output.
- system_target_files_temp_dir = os.path.join(temp_dir, 'system')
- other_target_files_temp_dir = os.path.join(temp_dir, 'other')
+ framework_target_files_temp_dir = os.path.join(temp_dir, 'framework')
+ vendor_target_files_temp_dir = os.path.join(temp_dir, 'vendor')
output_target_files_temp_dir = os.path.join(temp_dir, 'output')
- # Extract "as is" items from the input system partial target files package.
+ # Extract "as is" items from the input framework partial target files package.
# We extract them directly into the output temporary directory since the
# items do not need special case processing.
extract_items(
- target_files=system_target_files,
+ target_files=framework_target_files,
target_files_temp_dir=output_target_files_temp_dir,
- extract_item_list=system_item_list)
+ extract_item_list=framework_item_list)
- # Extract "as is" items from the input other partial target files package. We
+ # Extract "as is" items from the input vendor partial target files package. We
# extract them directly into the output temporary directory since the items
# do not need special case processing.
extract_items(
- target_files=other_target_files,
+ target_files=vendor_target_files,
target_files_temp_dir=output_target_files_temp_dir,
- extract_item_list=other_item_list)
+ extract_item_list=vendor_item_list)
- # Extract "special" items from the input system partial target files package.
+ # Extract "special" items from the input framework partial target files
+ # package. We extract these items to different directory since they require
+ # special processing before they will end up in the output directory.
+
+ extract_items(
+ target_files=framework_target_files,
+ target_files_temp_dir=framework_target_files_temp_dir,
+ extract_item_list=FRAMEWORK_EXTRACT_SPECIAL_ITEM_LIST)
+
+ # Extract "special" items from the input vendor partial target files package.
# We extract these items to different directory since they require special
# processing before they will end up in the output directory.
extract_items(
- target_files=system_target_files,
- target_files_temp_dir=system_target_files_temp_dir,
- extract_item_list=system_extract_special_item_list)
-
- # Extract "special" items from the input other partial target files package.
- # We extract these items to different directory since they require special
- # processing before they will end up in the output directory.
-
- extract_items(
- target_files=other_target_files,
- target_files_temp_dir=other_target_files_temp_dir,
- extract_item_list=other_extract_special_item_list)
+ target_files=vendor_target_files,
+ target_files_temp_dir=vendor_target_files_temp_dir,
+ extract_item_list=VENDOR_EXTRACT_SPECIAL_ITEM_LIST)
# Now that the temporary directories contain all the extracted files, perform
# special case processing on any items that need it. After this function
@@ -793,10 +830,10 @@
# files package are in place.
process_special_cases(
- system_target_files_temp_dir=system_target_files_temp_dir,
- other_target_files_temp_dir=other_target_files_temp_dir,
+ framework_target_files_temp_dir=framework_target_files_temp_dir,
+ vendor_target_files_temp_dir=vendor_target_files_temp_dir,
output_target_files_temp_dir=output_target_files_temp_dir,
- system_misc_info_keys=system_misc_info_keys,
+ framework_misc_info_keys=framework_misc_info_keys,
rebuild_recovery=rebuild_recovery)
# Regenerate IMAGES in the temporary directory.
@@ -894,6 +931,7 @@
]
logger.info('creating %s', output_target_files)
common.RunAndWait(command, verbose=True)
+ logger.info('finished creating %s', output_target_files)
# Create the OTA package from the merged target files package.
@@ -945,15 +983,35 @@
def option_handler(o, a):
if o == '--system-target-files':
- OPTIONS.system_target_files = a
+ logger.warning(
+ '--system-target-files has been renamed to --framework-target-files')
+ OPTIONS.framework_target_files = a
+ elif o == '--framework-target-files':
+ OPTIONS.framework_target_files = a
elif o == '--system-item-list':
- OPTIONS.system_item_list = a
+ logger.warning(
+ '--system-item-list has been renamed to --framework-item-list')
+ OPTIONS.framework_item_list = a
+ elif o == '--framework-item-list':
+ OPTIONS.framework_item_list = a
elif o == '--system-misc-info-keys':
- OPTIONS.system_misc_info_keys = a
+ logger.warning(
+ '--system-misc-info-keys has been renamed to --framework-misc-info-keys'
+ )
+ OPTIONS.framework_misc_info_keys = a
+ elif o == '--framework-misc-info-keys':
+ OPTIONS.framework_misc_info_keys = a
elif o == '--other-target-files':
- OPTIONS.other_target_files = a
+ logger.warning(
+ '--other-target-files has been renamed to --vendor-target-files')
+ OPTIONS.vendor_target_files = a
+ elif o == '--vendor-target-files':
+ OPTIONS.vendor_target_files = a
elif o == '--other-item-list':
- OPTIONS.other_item_list = a
+ logger.warning('--other-item-list has been renamed to --vendor-item-list')
+ OPTIONS.vendor_item_list = a
+ elif o == '--vendor-item-list':
+ OPTIONS.vendor_item_list = a
elif o == '--output-target-files':
OPTIONS.output_target_files = a
elif o == '--output-dir':
@@ -979,10 +1037,15 @@
__doc__,
extra_long_opts=[
'system-target-files=',
+ 'framework-target-files=',
'system-item-list=',
+ 'framework-item-list=',
'system-misc-info-keys=',
+ 'framework-misc-info-keys=',
'other-target-files=',
+ 'vendor-target-files=',
'other-item-list=',
+ 'vendor-item-list=',
'output-target-files=',
'output-dir=',
'output-item-list=',
@@ -994,27 +1057,28 @@
],
extra_option_handler=option_handler)
- if (args or OPTIONS.system_target_files is None or
- OPTIONS.other_target_files is None or
+ if (args or OPTIONS.framework_target_files is None or
+ OPTIONS.vendor_target_files is None or
(OPTIONS.output_target_files is None and OPTIONS.output_dir is None) or
(OPTIONS.output_dir is not None and OPTIONS.output_item_list is None)):
common.Usage(__doc__)
sys.exit(1)
- if OPTIONS.system_item_list:
- system_item_list = read_config_list(OPTIONS.system_item_list)
+ if OPTIONS.framework_item_list:
+ framework_item_list = read_config_list(OPTIONS.framework_item_list)
else:
- system_item_list = default_system_item_list
+ framework_item_list = DEFAULT_FRAMEWORK_ITEM_LIST
- if OPTIONS.system_misc_info_keys:
- system_misc_info_keys = read_config_list(OPTIONS.system_misc_info_keys)
+ if OPTIONS.framework_misc_info_keys:
+ framework_misc_info_keys = read_config_list(
+ OPTIONS.framework_misc_info_keys)
else:
- system_misc_info_keys = default_system_misc_info_keys
+ framework_misc_info_keys = DEFAULT_FRAMEWORK_MISC_INFO_KEYS
- if OPTIONS.other_item_list:
- other_item_list = read_config_list(OPTIONS.other_item_list)
+ if OPTIONS.vendor_item_list:
+ vendor_item_list = read_config_list(OPTIONS.vendor_item_list)
else:
- other_item_list = default_other_item_list
+ vendor_item_list = DEFAULT_VENDOR_ITEM_LIST
if OPTIONS.output_item_list:
output_item_list = read_config_list(OPTIONS.output_item_list)
@@ -1022,19 +1086,19 @@
output_item_list = None
if not validate_config_lists(
- system_item_list=system_item_list,
- system_misc_info_keys=system_misc_info_keys,
- other_item_list=other_item_list):
+ framework_item_list=framework_item_list,
+ framework_misc_info_keys=framework_misc_info_keys,
+ vendor_item_list=vendor_item_list):
sys.exit(1)
call_func_with_temp_dir(
lambda temp_dir: merge_target_files(
temp_dir=temp_dir,
- system_target_files=OPTIONS.system_target_files,
- system_item_list=system_item_list,
- system_misc_info_keys=system_misc_info_keys,
- other_target_files=OPTIONS.other_target_files,
- other_item_list=other_item_list,
+ framework_target_files=OPTIONS.framework_target_files,
+ framework_item_list=framework_item_list,
+ framework_misc_info_keys=framework_misc_info_keys,
+ vendor_target_files=OPTIONS.vendor_target_files,
+ vendor_item_list=vendor_item_list,
output_target_files=OPTIONS.output_target_files,
output_dir=OPTIONS.output_dir,
output_item_list=output_item_list,
diff --git a/tools/releasetools/test_merge_target_files.py b/tools/releasetools/test_merge_target_files.py
index 1e29fde..0a636bb 100644
--- a/tools/releasetools/test_merge_target_files.py
+++ b/tools/releasetools/test_merge_target_files.py
@@ -19,9 +19,9 @@
import common
import test_utils
from merge_target_files import (read_config_list, validate_config_lists,
- default_system_item_list,
- default_other_item_list,
- default_system_misc_info_keys, copy_items,
+ DEFAULT_FRAMEWORK_ITEM_LIST,
+ DEFAULT_VENDOR_ITEM_LIST,
+ DEFAULT_FRAMEWORK_MISC_INFO_KEYS, copy_items,
merge_dynamic_partition_info_dicts,
process_apex_keys_apk_certs_common)
@@ -84,10 +84,10 @@
os.readlink(os.path.join(output_dir, 'a_link.cpp')), 'a.cpp')
def test_read_config_list(self):
- system_item_list_file = os.path.join(self.testdata_dir,
- 'merge_config_system_item_list')
- system_item_list = read_config_list(system_item_list_file)
- expected_system_item_list = [
+ framework_item_list_file = os.path.join(self.testdata_dir,
+ 'merge_config_framework_item_list')
+ framework_item_list = read_config_list(framework_item_list_file)
+ expected_framework_item_list = [
'META/apkcerts.txt',
'META/filesystem_config.txt',
'META/root_filesystem_config.txt',
@@ -98,46 +98,58 @@
'ROOT/*',
'SYSTEM/*',
]
- self.assertItemsEqual(system_item_list, expected_system_item_list)
+ self.assertItemsEqual(framework_item_list, expected_framework_item_list)
def test_validate_config_lists_ReturnsFalseIfMissingDefaultItem(self):
- system_item_list = default_system_item_list[:]
- system_item_list.remove('SYSTEM/*')
+ framework_item_list = list(DEFAULT_FRAMEWORK_ITEM_LIST)
+ framework_item_list.remove('SYSTEM/*')
self.assertFalse(
- validate_config_lists(system_item_list, default_system_misc_info_keys,
- default_other_item_list))
+ validate_config_lists(framework_item_list,
+ DEFAULT_FRAMEWORK_MISC_INFO_KEYS,
+ DEFAULT_VENDOR_ITEM_LIST))
def test_validate_config_lists_ReturnsTrueIfDefaultItemInDifferentList(self):
- system_item_list = default_system_item_list[:]
- system_item_list.remove('ROOT/*')
- other_item_list = default_other_item_list[:]
- other_item_list.append('ROOT/*')
+ framework_item_list = list(DEFAULT_FRAMEWORK_ITEM_LIST)
+ framework_item_list.remove('ROOT/*')
+ vendor_item_list = list(DEFAULT_VENDOR_ITEM_LIST)
+ vendor_item_list.append('ROOT/*')
self.assertTrue(
- validate_config_lists(system_item_list, default_system_misc_info_keys,
- other_item_list))
+ validate_config_lists(framework_item_list,
+ DEFAULT_FRAMEWORK_MISC_INFO_KEYS,
+ vendor_item_list))
def test_validate_config_lists_ReturnsTrueIfExtraItem(self):
- system_item_list = default_system_item_list[:]
- system_item_list.append('MY_NEW_PARTITION/*')
+ framework_item_list = list(DEFAULT_FRAMEWORK_ITEM_LIST)
+ framework_item_list.append('MY_NEW_PARTITION/*')
self.assertTrue(
- validate_config_lists(system_item_list, default_system_misc_info_keys,
- default_other_item_list))
+ validate_config_lists(framework_item_list,
+ DEFAULT_FRAMEWORK_MISC_INFO_KEYS,
+ DEFAULT_VENDOR_ITEM_LIST))
+
+ def test_validate_config_lists_ReturnsFalseIfSharedExtractedPartition(self):
+ vendor_item_list = list(DEFAULT_VENDOR_ITEM_LIST)
+ vendor_item_list.append('SYSTEM/my_system_file')
+ self.assertFalse(
+ validate_config_lists(DEFAULT_FRAMEWORK_ITEM_LIST,
+ DEFAULT_FRAMEWORK_MISC_INFO_KEYS,
+ vendor_item_list))
def test_validate_config_lists_ReturnsFalseIfBadSystemMiscInfoKeys(self):
for bad_key in ['dynamic_partition_list', 'super_partition_groups']:
- system_misc_info_keys = default_system_misc_info_keys[:]
- system_misc_info_keys.append(bad_key)
+ framework_misc_info_keys = list(DEFAULT_FRAMEWORK_MISC_INFO_KEYS)
+ framework_misc_info_keys.append(bad_key)
self.assertFalse(
- validate_config_lists(default_system_item_list, system_misc_info_keys,
- default_other_item_list))
+ validate_config_lists(DEFAULT_FRAMEWORK_ITEM_LIST,
+ framework_misc_info_keys,
+ DEFAULT_VENDOR_ITEM_LIST))
def test_merge_dynamic_partition_info_dicts_ReturnsMergedDict(self):
- system_dict = {
+ framework_dict = {
'super_partition_groups': 'group_a',
'dynamic_partition_list': 'system',
'super_group_a_list': 'system',
}
- other_dict = {
+ vendor_dict = {
'super_partition_groups': 'group_a group_b',
'dynamic_partition_list': 'vendor product',
'super_group_a_list': 'vendor',
@@ -146,8 +158,8 @@
'super_group_b_size': '2000',
}
merged_dict = merge_dynamic_partition_info_dicts(
- system_dict=system_dict,
- other_dict=other_dict,
+ framework_dict=framework_dict,
+ vendor_dict=vendor_dict,
size_prefix='super_',
size_suffix='_size',
list_prefix='super_',
@@ -166,19 +178,19 @@
output_dir = common.MakeTempDir()
os.makedirs(os.path.join(output_dir, 'META'))
- system_dir = common.MakeTempDir()
- os.makedirs(os.path.join(system_dir, 'META'))
+ framework_dir = common.MakeTempDir()
+ os.makedirs(os.path.join(framework_dir, 'META'))
os.symlink(
- os.path.join(self.testdata_dir, 'apexkeys_system.txt'),
- os.path.join(system_dir, 'META', 'apexkeys.txt'))
+ os.path.join(self.testdata_dir, 'apexkeys_framework.txt'),
+ os.path.join(framework_dir, 'META', 'apexkeys.txt'))
- other_dir = common.MakeTempDir()
- os.makedirs(os.path.join(other_dir, 'META'))
+ vendor_dir = common.MakeTempDir()
+ os.makedirs(os.path.join(vendor_dir, 'META'))
os.symlink(
- os.path.join(self.testdata_dir, 'apexkeys_other.txt'),
- os.path.join(other_dir, 'META', 'apexkeys.txt'))
+ os.path.join(self.testdata_dir, 'apexkeys_vendor.txt'),
+ os.path.join(vendor_dir, 'META', 'apexkeys.txt'))
- process_apex_keys_apk_certs_common(system_dir, other_dir, output_dir,
+ process_apex_keys_apk_certs_common(framework_dir, vendor_dir, output_dir,
'apexkeys.txt')
merged_entries = []
@@ -199,17 +211,17 @@
output_dir = common.MakeTempDir()
os.makedirs(os.path.join(output_dir, 'META'))
- system_dir = common.MakeTempDir()
- os.makedirs(os.path.join(system_dir, 'META'))
+ framework_dir = common.MakeTempDir()
+ os.makedirs(os.path.join(framework_dir, 'META'))
os.symlink(
- os.path.join(self.testdata_dir, 'apexkeys_system.txt'),
- os.path.join(system_dir, 'META', 'apexkeys.txt'))
+ os.path.join(self.testdata_dir, 'apexkeys_framework.txt'),
+ os.path.join(framework_dir, 'META', 'apexkeys.txt'))
conflict_dir = common.MakeTempDir()
os.makedirs(os.path.join(conflict_dir, 'META'))
os.symlink(
- os.path.join(self.testdata_dir, 'apexkeys_system_conflict.txt'),
+ os.path.join(self.testdata_dir, 'apexkeys_framework_conflict.txt'),
os.path.join(conflict_dir, 'META', 'apexkeys.txt'))
self.assertRaises(ValueError, process_apex_keys_apk_certs_common,
- system_dir, conflict_dir, output_dir, 'apexkeys.txt')
+ framework_dir, conflict_dir, output_dir, 'apexkeys.txt')
diff --git a/tools/releasetools/testdata/apexkeys_system.txt b/tools/releasetools/testdata/apexkeys_framework.txt
similarity index 100%
rename from tools/releasetools/testdata/apexkeys_system.txt
rename to tools/releasetools/testdata/apexkeys_framework.txt
diff --git a/tools/releasetools/testdata/apexkeys_system_conflict.txt b/tools/releasetools/testdata/apexkeys_framework_conflict.txt
similarity index 100%
rename from tools/releasetools/testdata/apexkeys_system_conflict.txt
rename to tools/releasetools/testdata/apexkeys_framework_conflict.txt
diff --git a/tools/releasetools/testdata/apexkeys_other.txt b/tools/releasetools/testdata/apexkeys_vendor.txt
similarity index 100%
rename from tools/releasetools/testdata/apexkeys_other.txt
rename to tools/releasetools/testdata/apexkeys_vendor.txt
diff --git a/tools/releasetools/testdata/merge_config_system_item_list b/tools/releasetools/testdata/merge_config_framework_item_list
similarity index 100%
rename from tools/releasetools/testdata/merge_config_system_item_list
rename to tools/releasetools/testdata/merge_config_framework_item_list
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 1c856a8..37d5d27 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -327,11 +327,14 @@
cmd = ['avbtool', 'verify_image', '--image', image, '--key', key]
# Append the args for chained partitions if any.
- for partition in common.AVB_PARTITIONS:
+ for partition in common.AVB_PARTITIONS + common.AVB_VBMETA_PARTITIONS:
key_name = 'avb_' + partition + '_key_path'
if info_dict.get(key_name) is not None:
+ # Use the key file from command line if specified; otherwise fall back
+ # to the one in info dict.
+ key_file = options.get(key_name, info_dict[key_name])
chained_partition_arg = common.GetAvbChainedPartitionArg(
- partition, info_dict, options[key_name])
+ partition, info_dict, key_file)
cmd.extend(["--expected_chain_partition", chained_partition_arg])
proc = common.Run(cmd)
@@ -357,7 +360,7 @@
help='the verity public key to verify the bootable images (Verified '
'Boot 1.0), or the vbmeta image (Verified Boot 2.0, aka AVB), where '
'applicable')
- for partition in common.AVB_PARTITIONS:
+ for partition in common.AVB_PARTITIONS + common.AVB_VBMETA_PARTITIONS:
parser.add_argument(
'--avb_' + partition + '_key_path',
help='the public or private key in PEM format to verify AVB chained '