From 382be36c4389387a9d683ba3e1277b55f7051deb Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Tue, 6 Apr 2021 10:37:24 -0400 Subject: [PATCH] Add LOCAL_FULL_INIT_RC to handle init_rc full path Soong supports references to other modules for init_rc property, so full paths need to be passed from Soong to make rather than module local paths. Test: m droid dist Bug: 184567830 Change-Id: Ib1873a3418830f5cbf32e26f55d3ad0ab0d9c9c5 --- core/base_rules.mk | 8 ++++++-- core/clear_vars.mk | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index 68f880f26..c973997a8 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -533,13 +533,17 @@ endif ifndef LOCAL_IS_HOST_MODULE # Rule to install the module's companion init.rc. -my_init_rc := $(LOCAL_INIT_RC_$(my_32_64_bit_suffix)) $(LOCAL_INIT_RC) +ifneq ($(strip $(LOCAL_FULL_INIT_RC)),) +my_init_rc := $(LOCAL_FULL_INIT_RC) +else +my_init_rc := $(foreach rc,$(LOCAL_INIT_RC_$(my_32_64_bit_suffix)) $(LOCAL_INIT_RC),$(LOCAL_PATH)/$(rc)) +endif ifneq ($(strip $(my_init_rc)),) # Make doesn't support recovery as an output partition, but some Soong modules installed in recovery # have init.rc files that need to be installed alongside them. Manually handle the case where the # output file is in the recovery partition. my_init_rc_path := $(if $(filter $(TARGET_RECOVERY_ROOT_OUT)/%,$(my_module_path)),$(TARGET_RECOVERY_ROOT_OUT)/system/etc,$(TARGET_OUT$(partition_tag)_ETC)) -my_init_rc_pairs := $(foreach rc,$(my_init_rc),$(LOCAL_PATH)/$(rc):$(my_init_rc_path)/init/$(notdir $(rc))) +my_init_rc_pairs := $(foreach rc,$(my_init_rc),$(rc):$(my_init_rc_path)/init/$(notdir $(rc))) my_init_rc_installed := $(foreach rc,$(my_init_rc_pairs),$(call word-colon,2,$(rc))) # Make sure we only set up the copy rules once, even if another arch variant diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 019892e5e..738ed4cfa 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -106,6 +106,7 @@ LOCAL_FINDBUGS_FLAGS:= LOCAL_FORCE_STATIC_EXECUTABLE:= LOCAL_FULL_CLASSES_JACOCO_JAR:= LOCAL_FULL_CLASSES_PRE_JACOCO_JAR:= +LOCAL_FULL_INIT_RC:= LOCAL_FULL_LIBS_MANIFEST_FILES:= LOCAL_FULL_MANIFEST_FILE:= LOCAL_FULL_TEST_CONFIG:=