Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9738259f authored by Jooyung Han's avatar Jooyung Han
Browse files

checkvintf with all apexes

Previously, checkvintf read only vendor apexes. Now, we support vintf
from other apexes.

Bug: 327365139
Test: m check-vintf-all
Change-Id: I46dc04ccdbe7d3f035ea9f63b1e45358ab31021b
parent 85acebd1
Loading
Loading
Loading
Loading
+17 −8
Original line number Original line Diff line number Diff line
@@ -5061,9 +5061,12 @@ intermediates := $(call intermediates-dir-for,PACKAGING,check_vintf_all)
check_vintf_all_deps :=
check_vintf_all_deps :=


# -----------------------------------------------------------------
# -----------------------------------------------------------------
# Activate vendor APEXes for checkvintf
# Activate APEXes for checkvintf


apex_dirs := \
apex_dirs := \
  $(TARGET_OUT)/apex/% \
  $(TARGET_OUT_PRODUCT)/apex/% \
  $(TARGET_OUT_SYSTEM_EXT)/apex/% \
  $(TARGET_OUT_VENDOR)/apex/% \
  $(TARGET_OUT_VENDOR)/apex/% \


apex_files := $(sort $(filter $(apex_dirs), $(INTERNAL_ALLIMAGES_FILES)))
apex_files := $(sort $(filter $(apex_dirs), $(INTERNAL_ALLIMAGES_FILES)))
@@ -5079,7 +5082,10 @@ $(APEX_INFO_FILE): $(HOST_OUT_EXECUTABLES)/apexd_host $(apex_files)
	@echo $(PRIVATE_APEX_FILES) > /dev/null
	@echo $(PRIVATE_APEX_FILES) > /dev/null
	@rm -rf $(APEX_OUT)
	@rm -rf $(APEX_OUT)
	@mkdir -p $(APEX_OUT)
	@mkdir -p $(APEX_OUT)
	$< --vendor_path $(TARGET_OUT_VENDOR) \
	$< --system_path $(TARGET_OUT) \
	   --system_ext_path $(TARGET_OUT_SYSTEM_EXT) \
	   --product_path $(TARGET_OUT_PRODUCT) \
	   --vendor_path $(TARGET_OUT_VENDOR) \
	   --apex_path $(APEX_OUT)
	   --apex_path $(APEX_OUT)


apex_files :=
apex_files :=
@@ -5087,14 +5093,14 @@ apex_dirs :=


# The build system only writes VINTF metadata to */etc/vintf paths. Legacy paths aren't needed here
# 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.
# because they are only used for prebuilt images.
# APEX files in /vendor/apex can have VINTF fragments as well.
# APEX files in /$partition/apex can have VINTF fragments as well.
check_vintf_common_srcs_patterns := \
check_vintf_common_srcs_patterns := \
  $(TARGET_OUT)/etc/vintf/% \
  $(TARGET_OUT)/etc/vintf/% \
  $(TARGET_OUT_VENDOR)/etc/vintf/% \
  $(TARGET_OUT_VENDOR)/etc/vintf/% \
  $(TARGET_OUT_ODM)/etc/vintf/% \
  $(TARGET_OUT_ODM)/etc/vintf/% \
  $(TARGET_OUT_PRODUCT)/etc/vintf/% \
  $(TARGET_OUT_PRODUCT)/etc/vintf/% \
  $(TARGET_OUT_SYSTEM_EXT)/etc/vintf/% \
  $(TARGET_OUT_SYSTEM_EXT)/etc/vintf/% \
  $(TARGET_OUT_VENDOR)/apex/% \
  $(apex_dirs)


check_vintf_common_srcs := $(sort $(filter $(check_vintf_common_srcs_patterns),$(INTERNAL_ALLIMAGES_FILES)))
check_vintf_common_srcs := $(sort $(filter $(check_vintf_common_srcs_patterns),$(INTERNAL_ALLIMAGES_FILES)))
check_vintf_common_srcs_patterns :=
check_vintf_common_srcs_patterns :=
@@ -5112,15 +5118,17 @@ endif
# -- Check system and system_ext manifests / matrices including fragments (excluding other framework manifests / matrices, e.g. product);
# -- Check system and system_ext manifests / matrices including fragments (excluding other framework manifests / matrices, e.g. product);
ifdef BUILDING_SYSTEM_IMAGE
ifdef BUILDING_SYSTEM_IMAGE
check_vintf_system_deps := $(filter $(TARGET_OUT)/etc/vintf/% \
check_vintf_system_deps := $(filter $(TARGET_OUT)/etc/vintf/% \
                                    $(TARGET_OUT_SYSTEM_EXT)/etc/vintf/%, \
                                    $(TARGET_OUT_SYSTEM_EXT)/etc/vintf/% \
                                    $(TARGET_OUT)/apex/% \
                                    $(TARGET_OUT_SYSTEM_EXT)/apex/%, \
                                    $(check_vintf_common_srcs))
                                    $(check_vintf_common_srcs))
ifneq ($(check_vintf_system_deps),)
ifneq ($(check_vintf_system_deps),)
check_vintf_has_system := true
check_vintf_has_system := true


check_vintf_system_log := $(intermediates)/check_vintf_system.log
check_vintf_system_log := $(intermediates)/check_vintf_system.log
check_vintf_all_deps += $(check_vintf_system_log)
check_vintf_all_deps += $(check_vintf_system_log)
$(check_vintf_system_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_system_deps)
$(check_vintf_system_log): $(HOST_OUT_EXECUTABLES)/checkvintf $(check_vintf_system_deps) $(APEX_INFO_FILE)
	@( $< --check-one --dirmap /system:$(TARGET_OUT) > $@ 2>&1 ) || ( cat $@ && exit 1 )
	@( $< --check-one --dirmap /system:$(TARGET_OUT) --dirmap /apex:$(APEX_OUT) > $@ 2>&1 ) || ( cat $@ && exit 1 )
$(call declare-1p-target,$(check_vintf_system_log))
$(call declare-1p-target,$(check_vintf_system_log))
check_vintf_system_log :=
check_vintf_system_log :=


@@ -5129,10 +5137,11 @@ ifneq (true, $(BUILDING_VENDOR_IMAGE))
    vintffm_log := $(intermediates)/vintffm.log
    vintffm_log := $(intermediates)/vintffm.log
endif
endif
check_vintf_all_deps += $(vintffm_log)
check_vintf_all_deps += $(vintffm_log)
$(vintffm_log): $(HOST_OUT_EXECUTABLES)/vintffm $(check_vintf_system_deps)
$(vintffm_log): $(HOST_OUT_EXECUTABLES)/vintffm $(check_vintf_system_deps) $(APEX_INFO_FILE)
	@( $< --check --dirmap /system:$(TARGET_OUT) \
	@( $< --check --dirmap /system:$(TARGET_OUT) \
	  --dirmap /system_ext:$(TARGET_OUT_SYSTEM_EXT) \
	  --dirmap /system_ext:$(TARGET_OUT_SYSTEM_EXT) \
	  --dirmap /product:$(TARGET_OUT_PRODUCT) \
	  --dirmap /product:$(TARGET_OUT_PRODUCT) \
	  --dirmap /apex:$(APEX_OUT) \
	  $(VINTF_FRAMEWORK_MANIFEST_FROZEN_DIR) > $@ 2>&1 ) || ( cat $@ && exit 1 )
	  $(VINTF_FRAMEWORK_MANIFEST_FROZEN_DIR) > $@ 2>&1 ) || ( cat $@ && exit 1 )


$(call declare-1p-target,$(vintffm_log))
$(call declare-1p-target,$(vintffm_log))
+5 −4
Original line number Original line Diff line number Diff line
@@ -215,7 +215,7 @@ def PrepareApexDirectory(inp, dirmap):


  This simulates how apexd activates APEXes.
  This simulates how apexd activates APEXes.
  1. create {inp}/APEX which is treated as a "/apex" on device.
  1. create {inp}/APEX which is treated as a "/apex" on device.
  2. invoke apexd_host with vendor APEXes.
  2. invoke apexd_host with APEXes.
  """
  """


  apex_dir = common.MakeTempDir('APEX')
  apex_dir = common.MakeTempDir('APEX')
@@ -225,12 +225,13 @@ def PrepareApexDirectory(inp, dirmap):
  # Always create /apex directory for dirmap
  # Always create /apex directory for dirmap
  os.makedirs(apex_dir, exist_ok=True)
  os.makedirs(apex_dir, exist_ok=True)


  # Invoke apexd_host to activate vendor APEXes for checkvintf
  # Invoke apexd_host to activate APEXes for checkvintf
  apex_host = os.path.join(OPTIONS.search_path, 'bin', 'apexd_host')
  apex_host = os.path.join(OPTIONS.search_path, 'bin', 'apexd_host')
  cmd = [apex_host, '--tool_path', OPTIONS.search_path]
  cmd = [apex_host, '--tool_path', OPTIONS.search_path]
  cmd += ['--apex_path', dirmap['/apex']]
  cmd += ['--apex_path', dirmap['/apex']]
  if '/vendor' in dirmap:
  for p in ['system', 'system_ext', 'product', 'vendor']:
      cmd += ['--vendor_path', dirmap['/vendor']]
    if '/' + p in dirmap:
      cmd += ['--' + p + '_path', dirmap['/' + p]]
  common.RunAndCheckOutput(cmd)
  common.RunAndCheckOutput(cmd)