Merge "Refactor: remove --apex-info-file arg to checkvintf"
This commit is contained in:
@@ -4566,7 +4566,7 @@ APEX_INFO_FILE := $(APEX_OUT)/apex-info-list.xml
|
|||||||
|
|
||||||
$(APEX_INFO_FILE): $(HOST_OUT_EXECUTABLES)/dump_apex_info $(apex_vintf_files)
|
$(APEX_INFO_FILE): $(HOST_OUT_EXECUTABLES)/dump_apex_info $(apex_vintf_files)
|
||||||
@echo "Creating apex-info-file in $(PRODUCT_OUT) "
|
@echo "Creating apex-info-file in $(PRODUCT_OUT) "
|
||||||
$< --root_dir $(PRODUCT_OUT) --out_file $@
|
$< --root_dir $(PRODUCT_OUT)
|
||||||
|
|
||||||
apex_vintf_files :=
|
apex_vintf_files :=
|
||||||
|
|
||||||
@@ -4768,7 +4768,6 @@ check_vintf_compatible_args += \
|
|||||||
ifdef PRODUCT_SHIPPING_API_LEVEL
|
ifdef PRODUCT_SHIPPING_API_LEVEL
|
||||||
check_vintf_compatible_args += --property ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
|
check_vintf_compatible_args += --property ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
|
||||||
endif # PRODUCT_SHIPPING_API_LEVEL
|
endif # PRODUCT_SHIPPING_API_LEVEL
|
||||||
check_vintf_compatible_args += --apex-info-file $(APEX_INFO_FILE)
|
|
||||||
|
|
||||||
$(check_vintf_compatible_log): PRIVATE_CHECK_VINTF_ARGS := $(check_vintf_compatible_args)
|
$(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): PRIVATE_CHECK_VINTF_DEPS := $(check_vintf_compatible_deps)
|
||||||
|
@@ -129,8 +129,8 @@ def CheckVintfFromExtractedTargetFiles(input_tmp, info_dict=None):
|
|||||||
|
|
||||||
dirmap = GetDirmap(input_tmp)
|
dirmap = GetDirmap(input_tmp)
|
||||||
|
|
||||||
apex_root, apex_info_file = PrepareApexDirectory(input_tmp)
|
# Simulate apexd from target-files.
|
||||||
dirmap['/apex'] = apex_root
|
dirmap['/apex'] = PrepareApexDirectory(input_tmp)
|
||||||
|
|
||||||
args_for_skus = GetArgsForSkus(info_dict)
|
args_for_skus = GetArgsForSkus(info_dict)
|
||||||
shipping_api_level_args = GetArgsForShippingApiLevel(info_dict)
|
shipping_api_level_args = GetArgsForShippingApiLevel(info_dict)
|
||||||
@@ -140,7 +140,6 @@ def CheckVintfFromExtractedTargetFiles(input_tmp, info_dict=None):
|
|||||||
'checkvintf',
|
'checkvintf',
|
||||||
'--check-compat',
|
'--check-compat',
|
||||||
]
|
]
|
||||||
common_command += ['--apex-info-file', apex_info_file]
|
|
||||||
|
|
||||||
for device_path, real_path in sorted(dirmap.items()):
|
for device_path, real_path in sorted(dirmap.items()):
|
||||||
common_command += ['--dirmap', '{}:{}'.format(device_path, real_path)]
|
common_command += ['--dirmap', '{}:{}'.format(device_path, real_path)]
|
||||||
@@ -206,27 +205,29 @@ def GetVintfApexUnzipPatterns():
|
|||||||
return patterns
|
return patterns
|
||||||
|
|
||||||
def PrepareApexDirectory(inp):
|
def PrepareApexDirectory(inp):
|
||||||
""" Prepare the APEX data.
|
""" Prepare /apex directory before running checkvintf
|
||||||
|
|
||||||
Apex binaries do not support dirmaps, in order to use these binaries we
|
Apex binaries do not support dirmaps, in order to use these binaries we
|
||||||
need to move the APEXes from the extracted target file archives to the
|
need to move the APEXes from the extracted target file archives to the
|
||||||
expected device locations.
|
expected device locations.
|
||||||
|
|
||||||
The APEXes will also be extracted under the APEX/ directory
|
This simulates how apexd activates APEXes.
|
||||||
matching what would be on the target.
|
1. create {inp}/APEX which is treated as a "/" on device.
|
||||||
|
2. copy apexes from target-files to {root}/{partition}/apex.
|
||||||
|
3. mount apexes under {root}/{partition}/apex at {root}/apex.
|
||||||
|
4. generate info files with dump_apex_info.
|
||||||
|
|
||||||
Create the following structure under the input inp directory:
|
We'll get the following layout
|
||||||
APEX/apex # Extracted APEXes
|
{inp}/APEX/apex # Activated APEXes + some info files
|
||||||
APEX/system/apex/ # System APEXes
|
{inp}/APEX/system/apex # System APEXes
|
||||||
APEX/vendor/apex/ # Vendor APEXes
|
{inp}/APEX/vendor/apex # Vendor APEXes
|
||||||
...
|
...
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
inp: path to the directory that contains the extracted target files archive.
|
inp: path to the directory that contains the extracted target files archive.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
extracted apex directory
|
directory representing /apex on device
|
||||||
apex-info-list.xml file
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
deapexer = 'deapexer'
|
deapexer = 'deapexer'
|
||||||
@@ -273,15 +274,19 @@ def PrepareApexDirectory(inp):
|
|||||||
root_dir_name = 'APEX'
|
root_dir_name = 'APEX'
|
||||||
root_dir = os.path.join(inp, root_dir_name)
|
root_dir = os.path.join(inp, root_dir_name)
|
||||||
extracted_root = os.path.join(root_dir, 'apex')
|
extracted_root = os.path.join(root_dir, 'apex')
|
||||||
apex_info_file = os.path.join(extracted_root, 'apex-info-list.xml')
|
|
||||||
|
|
||||||
# Always create APEX directory for dirmap
|
# Always create /apex directory for dirmap
|
||||||
os.makedirs(extracted_root)
|
os.makedirs(extracted_root)
|
||||||
|
|
||||||
create_info_file = False
|
create_info_file = False
|
||||||
|
|
||||||
# Loop through search path looking for and processing apex/ directories.
|
# Loop through search path looking for and processing apex/ directories.
|
||||||
for device_path, target_files_rel_paths in DIR_SEARCH_PATHS.items():
|
for device_path, target_files_rel_paths in DIR_SEARCH_PATHS.items():
|
||||||
|
# checkvintf only needs vendor apexes. skip other partitions for efficiency
|
||||||
|
if device_path not in ['/vendor', '/odm']:
|
||||||
|
continue
|
||||||
|
# First, copy VENDOR/apex/foo.apex to APEX/vendor/apex/foo.apex
|
||||||
|
# Then, extract the contents to APEX/apex/foo/
|
||||||
for target_files_rel_path in target_files_rel_paths:
|
for target_files_rel_path in target_files_rel_paths:
|
||||||
inp_partition = os.path.join(inp, target_files_rel_path,"apex")
|
inp_partition = os.path.join(inp, target_files_rel_path,"apex")
|
||||||
if os.path.exists(inp_partition):
|
if os.path.exists(inp_partition):
|
||||||
@@ -292,16 +297,11 @@ def PrepareApexDirectory(inp):
|
|||||||
create_info_file = True
|
create_info_file = True
|
||||||
|
|
||||||
if create_info_file:
|
if create_info_file:
|
||||||
### Create apex-info-list.xml
|
### Dump apex info files
|
||||||
dump_cmd = ['dump_apex_info',
|
dump_cmd = ['dump_apex_info', '--root_dir', root_dir]
|
||||||
'--root_dir', root_dir,
|
|
||||||
'--out_file', apex_info_file]
|
|
||||||
common.RunAndCheckOutput(dump_cmd)
|
common.RunAndCheckOutput(dump_cmd)
|
||||||
if not os.path.exists(apex_info_file):
|
|
||||||
raise RuntimeError('Failed to create apex info file %s', apex_info_file)
|
|
||||||
logger.info('Created %s', apex_info_file)
|
|
||||||
|
|
||||||
return extracted_root, apex_info_file
|
return extracted_root
|
||||||
|
|
||||||
def CheckVintfFromTargetFiles(inp, info_dict=None):
|
def CheckVintfFromTargetFiles(inp, info_dict=None):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user