Fix treble sepolicy tests and combine_maps script

* Since vFRC there are no more minor version, so combine_maps.py is
  fixed to correctly handle both vFRC version and prior V.v version.

* treble_sepolicy_tests_for_release.mk uses incorrect variable
  SYSTEM_EXT_PREBUILT_POLICY and PRODUCT_PREBUILT_POLICY, so fixing
  them.

Bug: 331866470
Test: m selinux_policy
Change-Id: I7a3ab7cf3abf2155c1998e1972adee1202af8dff
This commit is contained in:
Inseob Kim 2024-03-29 11:09:48 +09:00
parent 7b6ce3bf13
commit b30e2f05f7
2 changed files with 8 additions and 7 deletions

View file

@ -41,8 +41,9 @@ def Combine(top, bottom):
if len(top_type_set) == 1: if len(top_type_set) == 1:
continue continue
m = re.match(r"(\w+)_\d+_\d+", top_ta) m = re.fullmatch(r"(\w+?)_\d+(_0)?", top_ta)
# Typeattributes in V.v.cil have _V_v suffix, but not in V.v.ignore.cil # Typeattributes in V(.0).cil have _V(_0) suffix, but not in
# V(.0).ignore.cil
bottom_type = m.group(1) if m else top_ta bottom_type = m.group(1) if m else top_ta
# If type doesn't exist in bottom map, no need to maintain mappings to # If type doesn't exist in bottom map, no need to maintain mappings to

View file

@ -15,7 +15,7 @@ IS_TREBLE_TEST_ENABLED_PARTNER := false
ifeq ($(filter 26.0 27.0 28.0 29.0,$(version)),) ifeq ($(filter 26.0 27.0 28.0 29.0,$(version)),)
ifneq (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)$(BOARD_PRODUCT_PREBUILT_DIR)) ifneq (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)$(BOARD_PRODUCT_PREBUILT_DIR))
IS_TREBLE_TEST_ENABLED_PARTNER := true IS_TREBLE_TEST_ENABLED_PARTNER := true
endif # (,$(SYSTEM_EXT_PREBUILT_POLICY)$(PRODUCT_PREBUILT_POLICY)) endif # (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR)$(BOARD_PRODUCT_PREBUILT_DIR))
endif # ($(filter 26.0 27.0 28.0 29.0,$(version)),) endif # ($(filter 26.0 27.0 28.0 29.0,$(version)),)
include $(BUILD_SYSTEM)/base_rules.mk include $(BUILD_SYSTEM)/base_rules.mk
@ -30,18 +30,18 @@ $(version)_mapping.cil := $(call intermediates-dir-for,ETC,plat_$(version).cil)/
$(version)_mapping.ignore.cil := \ $(version)_mapping.ignore.cil := \
$(call intermediates-dir-for,ETC,$(version).ignore.cil)/$(version).ignore.cil $(call intermediates-dir-for,ETC,$(version).ignore.cil)/$(version).ignore.cil
ifeq ($(IS_TREBLE_TEST_ENABLED_PARTNER),true) ifeq ($(IS_TREBLE_TEST_ENABLED_PARTNER),true)
ifneq (,$(SYSTEM_EXT_PREBUILT_POLICY)) ifneq (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR))
$(version)_mapping.cil += \ $(version)_mapping.cil += \
$(call intermediates-dir-for,ETC,system_ext_$(version).cil)/system_ext_$(version).cil $(call intermediates-dir-for,ETC,system_ext_$(version).cil)/system_ext_$(version).cil
$(version)_mapping.ignore.cil += \ $(version)_mapping.ignore.cil += \
$(call intermediates-dir-for,ETC,system_ext_$(version).ignore.cil)/system_ext_$(version).ignore.cil $(call intermediates-dir-for,ETC,system_ext_$(version).ignore.cil)/system_ext_$(version).ignore.cil
endif # (,$(SYSTEM_EXT_PREBUILT_POLICY)) endif # (,$(BOARD_SYSTEM_EXT_PREBUILT_DIR))
ifneq (,$(PRODUCT_PREBUILT_POLICY)) ifneq (,$(BOARD_PRODUCT_PREBUILT_DIR))
$(version)_mapping.cil += \ $(version)_mapping.cil += \
$(call intermediates-dir-for,ETC,product_$(version).cil)/product_$(version).cil $(call intermediates-dir-for,ETC,product_$(version).cil)/product_$(version).cil
$(version)_mapping.ignore.cil += \ $(version)_mapping.ignore.cil += \
$(call intermediates-dir-for,ETC,product_$(version).ignore.cil)/product_$(version).ignore.cil $(call intermediates-dir-for,ETC,product_$(version).ignore.cil)/product_$(version).ignore.cil
endif # (,$(PRODUCT_PREBUILT_POLICY)) endif # (,$(BOARD_PRODUCT_PREBUILT_DIR))
endif #($(IS_TREBLE_TEST_ENABLED_PARTNER),true) endif #($(IS_TREBLE_TEST_ENABLED_PARTNER),true)
# $(version)_mapping.combined.cil - a combination of the mapping file used when # $(version)_mapping.combined.cil - a combination of the mapping file used when