Build DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
... along with compatibility_matrix.device.xml. The new module cm.device.xml contains the original content of empty.xml (kernel configs, sepolicy, etc.) as well as HALs from DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE. This variable points to a framework compatibility matrix that contains framework HALs as a vendor extension; all HALs in this file must be optional. Bug: 65028233 Test: m framework_compatibility_matrix.xml -j and manual inspection Test: vts_treble_vintf_test Change-Id: I94949f62f7f5b332d845f2e7fa4714df7c49ed3e Merged-In: I94949f62f7f5b332d845f2e7fa4714df7c49ed3e
This commit is contained in:
parent
c0660b0142
commit
13df628b8f
3 changed files with 50 additions and 4 deletions
|
@ -22,6 +22,7 @@ BUILD_FRAMEWORK_COMPATIBILITY_MATRIX := $(LOCAL_PATH)/compatibility_matrix.mk
|
||||||
LOCAL_ADD_VBMETA_VERSION :=
|
LOCAL_ADD_VBMETA_VERSION :=
|
||||||
LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
|
LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
|
||||||
LOCAL_ASSEMBLE_VINTF_FLAGS :=
|
LOCAL_ASSEMBLE_VINTF_FLAGS :=
|
||||||
|
LOCAL_WARN_REQUIRED_HALS :=
|
||||||
LOCAL_KERNEL_VERSIONS :=
|
LOCAL_KERNEL_VERSIONS :=
|
||||||
LOCAL_GEN_FILE_DEPENDENCIES :=
|
LOCAL_GEN_FILE_DEPENDENCIES :=
|
||||||
|
|
||||||
|
@ -57,14 +58,46 @@ include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
|
||||||
# Framework Compatibility Matrix (common to all FCM versions)
|
# Framework Compatibility Matrix (common to all FCM versions)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE_STEM := compatibility_matrix.empty.xml
|
LOCAL_MODULE_STEM := compatibility_matrix.device.xml
|
||||||
LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
|
# define LOCAL_MODULE and LOCAL_MODULE_CLASS for local-generated-sources-dir.
|
||||||
|
LOCAL_MODULE := framework_compatibility_matrix.device.xml
|
||||||
|
LOCAL_MODULE_CLASS := ETC
|
||||||
|
|
||||||
|
ifndef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
|
||||||
|
LOCAL_SRC_FILES := compatibility_matrix.empty.xml
|
||||||
|
else
|
||||||
|
|
||||||
|
# DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE specify an absolute path
|
||||||
|
LOCAL_GENERATED_SOURCES := $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE)
|
||||||
|
|
||||||
|
# Enforce that DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE does not specify required HALs
|
||||||
|
# by checking it against an empty manifest. But the empty manifest needs to contain
|
||||||
|
# BOARD_SEPOLICY_VERS to be compatible with DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE.
|
||||||
|
my_manifest_src_file := $(LOCAL_PATH)/manifest.empty.xml
|
||||||
|
my_gen_check_manifest := $(local-generated-sources-dir)/manifest.check.xml
|
||||||
|
$(my_gen_check_manifest): PRIVATE_SRC_FILE := $(my_manifest_src_file)
|
||||||
|
$(my_gen_check_manifest): $(my_manifest_src_file) $(HOST_OUT_EXECUTABLES)/assemble_vintf
|
||||||
|
BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \
|
||||||
|
IGNORE_TARGET_FCM_VERSION=true \
|
||||||
|
$(HOST_OUT_EXECUTABLES)/assemble_vintf -i $(PRIVATE_SRC_FILE) -o $@
|
||||||
|
|
||||||
|
LOCAL_GEN_FILE_DEPENDENCIES += $(my_gen_check_manifest)
|
||||||
|
LOCAL_ASSEMBLE_VINTF_FLAGS += -c "$(my_gen_check_manifest)"
|
||||||
|
|
||||||
|
my_gen_check_manifest :=
|
||||||
|
my_manifest_src_file :=
|
||||||
|
|
||||||
|
endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
|
||||||
|
|
||||||
LOCAL_ADD_VBMETA_VERSION := true
|
LOCAL_ADD_VBMETA_VERSION := true
|
||||||
LOCAL_ASSEMBLE_VINTF_ENV_VARS := \
|
LOCAL_ASSEMBLE_VINTF_ENV_VARS := \
|
||||||
POLICYVERS \
|
POLICYVERS \
|
||||||
PLATFORM_SEPOLICY_VERSION \
|
PLATFORM_SEPOLICY_VERSION \
|
||||||
PLATFORM_SEPOLICY_COMPAT_VERSIONS
|
PLATFORM_SEPOLICY_COMPAT_VERSIONS
|
||||||
|
|
||||||
|
LOCAL_WARN_REQUIRED_HALS := \
|
||||||
|
"Error: DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX cannot contain required HALs."
|
||||||
|
|
||||||
include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
|
include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
|
||||||
|
|
||||||
# Framework Compatibility Matrix
|
# Framework Compatibility Matrix
|
||||||
|
@ -78,7 +111,7 @@ LOCAL_REQUIRED_MODULES := \
|
||||||
framework_compatibility_matrix.1.xml \
|
framework_compatibility_matrix.1.xml \
|
||||||
framework_compatibility_matrix.2.xml \
|
framework_compatibility_matrix.2.xml \
|
||||||
framework_compatibility_matrix.current.xml \
|
framework_compatibility_matrix.current.xml \
|
||||||
framework_compatibility_matrix.empty.xml
|
framework_compatibility_matrix.device.xml
|
||||||
LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES))
|
LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES))
|
||||||
|
|
||||||
ifdef BUILT_VENDOR_MANIFEST
|
ifdef BUILT_VENDOR_MANIFEST
|
||||||
|
|
|
@ -29,8 +29,13 @@ ifndef LOCAL_MODULE_STEM
|
||||||
$(error LOCAL_MODULE_STEM must be defined.)
|
$(error LOCAL_MODULE_STEM must be defined.)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef LOCAL_MODULE
|
||||||
LOCAL_MODULE := framework_$(LOCAL_MODULE_STEM)
|
LOCAL_MODULE := framework_$(LOCAL_MODULE_STEM)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef LOCAL_MODULE_CLASS
|
||||||
LOCAL_MODULE_CLASS := ETC
|
LOCAL_MODULE_CLASS := ETC
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef LOCAL_MODULE_PATH
|
ifndef LOCAL_MODULE_PATH
|
||||||
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/vintf
|
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/vintf
|
||||||
|
@ -76,13 +81,19 @@ my_matrix_src_files := \
|
||||||
$(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) \
|
$(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) \
|
||||||
$(LOCAL_GENERATED_SOURCES)
|
$(LOCAL_GENERATED_SOURCES)
|
||||||
|
|
||||||
|
ifneq (,$(strip $(LOCAL_WARN_REQUIRED_HALS)))
|
||||||
|
$(GEN): PRIVATE_ADDITIONAL_ENV_VARS += PRODUCT_ENFORCE_VINTF_MANIFEST=true
|
||||||
|
$(GEN): PRIVATE_COMMAND_TAIL := || (echo $(strip $(LOCAL_WARN_REQUIRED_HALS)) && false)
|
||||||
|
endif
|
||||||
|
|
||||||
$(GEN): PRIVATE_SRC_FILES := $(my_matrix_src_files)
|
$(GEN): PRIVATE_SRC_FILES := $(my_matrix_src_files)
|
||||||
$(GEN): $(my_matrix_src_files) $(HOST_OUT_EXECUTABLES)/assemble_vintf
|
$(GEN): $(my_matrix_src_files) $(HOST_OUT_EXECUTABLES)/assemble_vintf
|
||||||
$(foreach varname,$(PRIVATE_ENV_VARS),$(varname)="$($(varname))") \
|
$(foreach varname,$(PRIVATE_ENV_VARS),$(varname)="$($(varname))") \
|
||||||
|
$(PRIVATE_ADDITIONAL_ENV_VARS) \
|
||||||
$(HOST_OUT_EXECUTABLES)/assemble_vintf \
|
$(HOST_OUT_EXECUTABLES)/assemble_vintf \
|
||||||
-i $(call normalize-path-list,$(PRIVATE_SRC_FILES)) \
|
-i $(call normalize-path-list,$(PRIVATE_SRC_FILES)) \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
$(PRIVATE_FLAGS)
|
$(PRIVATE_FLAGS) $(PRIVATE_COMMAND_TAIL)
|
||||||
|
|
||||||
LOCAL_PREBUILT_MODULE_FILE := $(GEN)
|
LOCAL_PREBUILT_MODULE_FILE := $(GEN)
|
||||||
LOCAL_SRC_FILES :=
|
LOCAL_SRC_FILES :=
|
||||||
|
@ -91,6 +102,7 @@ LOCAL_GENERATED_SOURCES :=
|
||||||
LOCAL_ADD_VBMETA_VERSION :=
|
LOCAL_ADD_VBMETA_VERSION :=
|
||||||
LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
|
LOCAL_ASSEMBLE_VINTF_ENV_VARS :=
|
||||||
LOCAL_ASSEMBLE_VINTF_FLAGS :=
|
LOCAL_ASSEMBLE_VINTF_FLAGS :=
|
||||||
|
LOCAL_WARN_REQUIRED_HALS :=
|
||||||
LOCAL_KERNEL_VERSIONS :=
|
LOCAL_KERNEL_VERSIONS :=
|
||||||
LOCAL_GEN_FILE_DEPENDENCIES :=
|
LOCAL_GEN_FILE_DEPENDENCIES :=
|
||||||
my_matrix_src_files :=
|
my_matrix_src_files :=
|
||||||
|
|
1
compatibility_matrices/manifest.empty.xml
Normal file
1
compatibility_matrices/manifest.empty.xml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<manifest version="1.0" type="device" />
|
Loading…
Reference in a new issue