Reland "Add check-vintf-all target."
This reverts commit 152a783e2b
.
Reason for revert: reland CL
Test: m check-vintf-all
Change-Id: I80fc789313edd3a9cc439a0b3a81e524e39b41b1
This commit is contained in:
parent
51be69f063
commit
bcd46bc540
1 changed files with 100 additions and 0 deletions
100
core/Makefile
100
core/Makefile
|
@ -3635,6 +3635,106 @@ endif # BUILDING_VBMETA_IMAGE
|
|||
|
||||
endif # BOARD_AVB_ENABLE
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# Check VINTF of build
|
||||
|
||||
ifndef TARGET_BUILD_APPS
|
||||
intermediates := $(call intermediates-dir-for,PACKAGING,check_vintf_all)
|
||||
check_vintf_all_deps :=
|
||||
|
||||
# -- Check VINTF compatibility of build.
|
||||
# Skip partial builds; only check full builds. Only check if:
|
||||
# - PRODUCT_ENFORCE_VINTF_MANIFEST is true
|
||||
# - Building system and vendor images
|
||||
# - Building product / system_ext / odm images if board has product / system_ext / odm images
|
||||
ifeq ($(PRODUCT_ENFORCE_VINTF_MANIFEST),true)
|
||||
ifeq ($(BUILDING_SYSTEM_IMAGE),true)
|
||||
ifeq ($(BUILDING_VENDOR_IMAGE),true)
|
||||
ifeq ($(filter true,$(BUILDING_ODM_IMAGE)),$(filter true,$(BOARD_USES_ODMIMAGE)))
|
||||
ifeq ($(filter true,$(BUILDING_PRODUCT_IMAGE)),$(filter true,$(BOARD_USES_PRODUCTIMAGE)))
|
||||
ifeq ($(filter true,$(BUILDING_SYSTEM_EXT_IMAGE)),$(filter true,$(BOARD_USES_SYSTEM_EXTIMAGE)))
|
||||
|
||||
check_vintf_compatible_log := $(intermediates)/check_vintf_compatible_log
|
||||
check_vintf_all_deps += $(check_vintf_compatible_log)
|
||||
|
||||
check_vintf_compatible_args :=
|
||||
check_vintf_compatible_deps :=
|
||||
|
||||
# -- Kernel version and configurations.
|
||||
ifeq ($(PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS),true)
|
||||
|
||||
check_vintf_compatible_args += --kernel $$(cat $(BUILT_KERNEL_VERSION_FILE)):$(BUILT_KERNEL_CONFIGS_FILE)
|
||||
check_vintf_compatible_deps += $(BUILT_KERNEL_CONFIGS_FILE) $(BUILT_KERNEL_VERSION_FILE)
|
||||
|
||||
endif # PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
|
||||
|
||||
# The build system only writes VINTF metadata to */etc/vintf paths. Legacy paths aren't needed here
|
||||
# because they are only used for prebuilt images.
|
||||
check_vintf_compatible_deps_patterns := \
|
||||
$(TARGET_OUT)/etc/vintf/% \
|
||||
$(TARGET_OUT_VENDOR)/etc/vintf/% \
|
||||
$(TARGET_OUT_ODM)/etc/vintf/% \
|
||||
$(TARGET_OUT_PRODUCT)/etc/vintf/% \
|
||||
$(TARGET_OUT_SYSTEM_EXT)/etc/vintf/% \
|
||||
|
||||
check_vintf_compatible_deps += $(sort $(filter $(check_vintf_compatible_deps_patterns), \
|
||||
$(INTERNAL_SYSTEMIMAGE_FILES) \
|
||||
$(INTERNAL_VENDORIMAGE_FILES) \
|
||||
$(INTERNAL_ODMIMAGE_FILES) \
|
||||
$(INTERNAL_PRODUCTIMAGE_FILES) \
|
||||
$(INTERNAL_SYSTEM_EXTIMAGE_FILES) \
|
||||
))
|
||||
check_vintf_compatible_deps_patterns :=
|
||||
|
||||
check_vintf_compatible_args += \
|
||||
--dirmap /system:$(TARGET_OUT) \
|
||||
--dirmap /vendor:$(TARGET_OUT_VENDOR) \
|
||||
--dirmap /odm:$(TARGET_OUT_ODM) \
|
||||
--dirmap /product:$(TARGET_OUT_PRODUCT) \
|
||||
--dirmap /system_ext:$(TARGET_OUT_SYSTEM_EXT) \
|
||||
|
||||
ifdef PRODUCT_SHIPPING_API_LEVEL
|
||||
check_vintf_compatible_args += --property ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
|
||||
endif # PRODUCT_SHIPPING_API_LEVEL
|
||||
|
||||
$(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_ARGS := $(check_vintf_compatible_args)
|
||||
$(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_DEPS := $(check_vintf_compatible_deps)
|
||||
$(check_vintf_compatible_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_compatible_deps)
|
||||
@echo -n -e 'Deps: \n ' > $@
|
||||
@sed 's/ /\n /g' <<< "$(PRIVATE_CHECK_VINTF_DEPS)" >> $@
|
||||
@echo -n -e 'Args: \n ' >> $@
|
||||
@cat <<< "$(PRIVATE_CHECK_VINTF_ARGS)" >> $@
|
||||
@echo -n -e 'For empty SKU:' >> $@
|
||||
@( $< --check-compat $(PRIVATE_CHECK_VINTF_ARGS) >> $@ 2>&1 ) || ( cat $@ && exit 1 )
|
||||
$(foreach sku,$(ODM_MANIFEST_SKUS), \
|
||||
echo "For SKU = $(sku):" >> $@; \
|
||||
( $< --check-compat $(PRIVATE_CHECK_VINTF_ARGS) \
|
||||
--property ro.boot.product.hardware.sku=$(sku) >> $@ 2>&1 ) || ( cat $@ && exit 1 ); )
|
||||
|
||||
check_vintf_compatible_log :=
|
||||
check_vintf_compatible_args :=
|
||||
check_vintf_compatible_deps :=
|
||||
|
||||
endif # BUILDING_SYSTEM_EXT_IMAGE equals BOARD_USES_SYSTEM_EXTIMAGE
|
||||
endif # BUILDING_PRODUCT_IMAGE equals BOARD_USES_PRODUCTIMAGE
|
||||
endif # BUILDING_ODM_IMAGE equals BOARD_USES_ODMIMAGE
|
||||
endif # BUILDING_VENDOR_IMAGE
|
||||
endif # BUILDING_SYSTEM_IMAGE
|
||||
endif # PRODUCT_ENFORCE_VINTF_MANIFEST
|
||||
|
||||
# Add all logs of VINTF checks to dist builds
|
||||
droid_targets: $(check_vintf_all_deps)
|
||||
$(call dist-for-goals, droid_targets, $(check_vintf_all_deps))
|
||||
|
||||
# Helper alias to check all VINTF of current build.
|
||||
.PHONY: check-vintf-all
|
||||
check-vintf-all: $(check_vintf_all_deps)
|
||||
$(foreach file,$^,echo "$(file)"; cat "$(file)"; echo;)
|
||||
|
||||
check_vintf_all_deps :=
|
||||
intermediates :=
|
||||
endif # !TARGET_BUILD_APPS
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# Check image sizes <= size of super partition
|
||||
|
||||
|
|
Loading…
Reference in a new issue