Merge "use first kernel when generating kernel configs file"
diff --git a/core/Makefile b/core/Makefile
index 3460914..8ac4e0d 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -4051,13 +4051,13 @@
$(foreach device,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \
echo "super_$(device)_device_size=$(BOARD_SUPER_PARTITION_$(call to-upper,$(device))_DEVICE_SIZE)" >> $(1);)
$(if $(BOARD_SUPER_PARTITION_PARTITION_LIST), \
- echo "dynamic_partition_list=$(call filter-out-missing-vendor, $(BOARD_SUPER_PARTITION_PARTITION_LIST))" >> $(1))
+ echo "dynamic_partition_list=$(call filter-out-missing-vendor,$(BOARD_SUPER_PARTITION_PARTITION_LIST))" >> $(1))
$(if $(BOARD_SUPER_PARTITION_GROUPS),
echo "super_partition_groups=$(BOARD_SUPER_PARTITION_GROUPS)" >> $(1))
$(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \
echo "super_$(group)_group_size=$(BOARD_$(call to-upper,$(group))_SIZE)" >> $(1); \
$(if $(BOARD_$(call to-upper,$(group))_PARTITION_LIST), \
- echo "super_$(group)_partition_list=$(call filter-out-missing-vendor, $(BOARD_$(call to-upper,$(group))_PARTITION_LIST))" >> $(1);))
+ echo "super_$(group)_partition_list=$(call filter-out-missing-vendor,$(BOARD_$(call to-upper,$(group))_PARTITION_LIST))" >> $(1);))
$(if $(filter true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)), \
echo "build_non_sparse_super_partition=true" >> $(1))
$(if $(filter true,$(TARGET_USERIMAGES_SPARSE_F2FS_DISABLED)), \
diff --git a/core/config.mk b/core/config.mk
index bb182aa..a5b8ef7 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -978,8 +978,7 @@
BOARD_SUPER_PARTITION_GROUPS and BOARD_*_PARTITION_LIST)
endif
BOARD_SUPER_PARTITION_PARTITION_LIST := \
- $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \
- $(BOARD_$(group)_PARTITION_LIST))
+ $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)),$(BOARD_$(group)_PARTITION_LIST))
.KATI_READONLY := BOARD_SUPER_PARTITION_PARTITION_LIST
ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
diff --git a/core/main.mk b/core/main.mk
index 2af1f92..cc7cf72 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -642,9 +642,11 @@
endef
# TODO(b/7456955): error if a required module doesn't exist.
-# Resolve the required module names in ALL_MODULES.*.REQUIRED_FROM_TARGET,
-# ALL_MODULES.*.REQUIRED_FROM_HOST and ALL_MODULES.*.REQUIRED_FROM_HOST_CROSS
-# to 32-bit or 64-bit variant.
+# Resolve the required module names to 32-bit or 64-bit variant for:
+# ALL_MODULES.<*>.REQUIRED_FROM_TARGET
+# ALL_MODULES.<*>.REQUIRED_FROM_HOST
+# ALL_MODULES.<*>.REQUIRED_FROM_HOST_CROSS
+#
# If a module is for cross host OS, the required modules are also for that OS.
# Required modules explicitly suffixed with :32 or :64 resolve to that bitness.
# Otherwise if the requiring module is native and the required module is shared
@@ -660,27 +662,53 @@
$(eval r := $(addprefix host_cross_,$(r)))) \
$(eval module_is_native := \
$(filter EXECUTABLES SHARED_LIBRARIES NATIVE_TESTS,$(ALL_MODULES.$(m).CLASS))) \
- $(eval r_r := $(foreach r_i,$(r), \
- $(if $(filter %:32 %:64,$(r_i)), \
- $(eval r_m := $(call resolve-bitness-for-modules,$(1),$(r_i))), \
- $(eval r_m := \
- $(eval r_i_2nd := $(call get-modules-for-2nd-arch,$(1),$(r_i))) \
- $(eval required_is_shared_library_or_native_test := \
- $(filter SHARED_LIBRARIES NATIVE_TESTS, \
- $(ALL_MODULES.$(r_i).CLASS) $(ALL_MODULES.$(r_i_2nd).CLASS))) \
- $(if $(and $(module_is_native),$(required_is_shared_library_or_native_test)), \
- $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),$(r_i_2nd),$(r_i)), \
- $(r_i) $(r_i_2nd)))) \
- $(eval ### TODO(b/7456955): error if r_m is empty / does not exist) \
- $(r_m))) \
+ $(eval r_r := \
+ $(foreach r_i,$(r), \
+ $(if $(filter %:32 %:64,$(r_i)), \
+ $(eval r_m := $(call resolve-bitness-for-modules,$(1),$(r_i))), \
+ $(eval r_m := \
+ $(eval r_i_2nd := $(call get-modules-for-2nd-arch,$(1),$(r_i))) \
+ $(eval required_is_shared_library_or_native_test := \
+ $(filter SHARED_LIBRARIES NATIVE_TESTS, \
+ $(ALL_MODULES.$(r_i).CLASS) $(ALL_MODULES.$(r_i_2nd).CLASS))) \
+ $(if $(and $(module_is_native),$(required_is_shared_library_or_native_test)), \
+ $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),$(r_i_2nd),$(r_i)), \
+ $(r_i) $(r_i_2nd)))) \
+ $(eval ### TODO(b/7456955): error if r_m is empty / does not exist) \
+ $(r_m))) \
$(eval ALL_MODULES.$(m).REQUIRED_FROM_$(1) := $(sort $(r_r))) \
) \
)
endef
+# Resolve the required module names to 32-bit or 64-bit variant for:
+# ALL_MODULES.<*>.TARGET_REQUIRED_FROM_HOST
+# ALL_MODULES.<*>.HOST_REQUIRED_FROM_TARGET
+#
+# This is like select-bitness-of-required-modules, but it doesn't have
+# complicated logic for various module types.
+# Calls resolve-bitness-for-modules to resolve module names.
+# $(1): TARGET or HOST
+# $(2): HOST or TARGET
+define select-bitness-of-target-host-required-modules
+$(foreach m,$(ALL_MODULES), \
+ $(eval r := $(ALL_MODULES.$(m).$(1)_REQUIRED_FROM_$(2))) \
+ $(if $(r), \
+ $(eval r_r := \
+ $(foreach r_i,$(r), \
+ $(eval r_m := $(call resolve-bitness-for-modules,$(1),$(r_i))) \
+ $(eval ### TODO(b/7456955): error if r_m is empty / does not exist) \
+ $(r_m))) \
+ $(eval ALL_MODULES.$(m).$(1)_REQUIRED_FROM_$(2) := $(sort $(r_r))) \
+ ) \
+)
+endef
+
$(call select-bitness-of-required-modules,TARGET)
$(call select-bitness-of-required-modules,HOST)
$(call select-bitness-of-required-modules,HOST_CROSS)
+$(call select-bitness-of-target-host-required-modules,TARGET,HOST)
+$(call select-bitness-of-target-host-required-modules,HOST,TARGET)
define add-required-deps
$(1): | $(2)
diff --git a/core/soong_android_app_set.mk b/core/soong_android_app_set.mk
index 5ed9b2c..eb8e5e7 100644
--- a/core/soong_android_app_set.mk
+++ b/core/soong_android_app_set.mk
@@ -31,4 +31,17 @@
$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
+# android_app_set modules are always presigned
+PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED
+PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
+
+ifneq ($(LOCAL_MODULE_STEM),)
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE_STEM)
+else
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE)
+endif
+
+# Set a actual_partition_tag (calculated in base_rules.mk) for the package.
+PACKAGES.$(LOCAL_MODULE).PARTITION := $(actual_partition_tag)
+
SOONG_ALREADY_CONV += $(LOCAL_MODULE)