From dcb5ef1333aa4e0fc987b68e27a24b1c63ce2f63 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Mon, 15 Oct 2018 11:35:15 +0100 Subject: [PATCH] Re-submit "Add trailing slash to mainline path claims." With a workaround for preopt files that get installed into an unknown path. The BoardConfig defines whether the files go in /system_other, so allow that. This reverts commit 46bf4b510cf3492eefaab8e7e36b5807a7c75aec. Test: lunch mainline_arm64-userdebug; m nothing Change-Id: Ia75670eb6e3730ad0ff17f5b81954b69f6cab22b --- core/main.mk | 17 +++++++++++++---- target/product/mainline_system.mk | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/main.mk b/core/main.mk index f26b2bb7a..ecb8c0da2 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1012,6 +1012,18 @@ ifdef FULL_BUILD product_FILES := $(call product-installed-files, $(INTERNAL_PRODUCT)) # Verify the artifact path requirements made by included products. + + # Fakes don't get installed, and host files are irrelevant. + static_whitelist_patterns := $(TARGET_OUT_FAKE)/% $(HOST_OUT)/% + # RROs become REQUIRED by the source module, but are always placed on the vendor partition. + static_whitelist_patterns += %__auto_generated_rro.apk + ifeq (true,$(BOARD_USES_SYSTEM_OTHER_ODEX)) + # Allow system_other odex space optimization. + static_whitelist_patterns += \ + $(TARGET_OUT_SYSTEM_OTHER)/%.odex \ + $(TARGET_OUT_SYSTEM_OTHER)/%.vdex \ + $(TARGET_OUT_SYSTEM_OTHER)/%.art + endif all_offending_files := $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ $(eval requirements := $(PRODUCTS.$(makefile).ARTIFACT_PATH_REQUIREMENTS)) \ @@ -1020,10 +1032,7 @@ ifdef FULL_BUILD $(eval path_patterns := $(call resolve-product-relative-paths,$(requirements),%)) \ $(eval whitelist_patterns := $(call resolve-product-relative-paths,$(whitelist))) \ $(eval files := $(call product-installed-files, $(makefile))) \ - $(eval files := $(filter-out $(TARGET_OUT_FAKE)/% $(HOST_OUT)/%,$(files))) \ - $(eval # RROs become REQUIRED by the source module, but are always placed on the vendor partition.) \ - $(eval files := $(filter-out %__auto_generated_rro.apk,$(files))) \ - $(eval offending_files := $(filter-out $(path_patterns) $(whitelist_patterns),$(files))) \ + $(eval offending_files := $(filter-out $(path_patterns) $(whitelist_patterns) $(static_whitelist_patterns),$(files))) \ $(call maybe-print-list-and-error,$(offending_files),$(makefile) produces files outside its artifact path requirement.) \ $(eval unused_whitelist := $(filter-out $(files),$(whitelist_patterns))) \ $(call maybe-print-list-and-error,$(unused_whitelist),$(makefile) includes redundant whitelist entries in its artifact path requirement.) \ diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk index 7677f219c..aded103b8 100644 --- a/target/product/mainline_system.mk +++ b/target/product/mainline_system.mk @@ -76,7 +76,7 @@ _my_whitelist := $(_base_mk_whitelist) # Both /system and / are in system.img when PRODUCT_SHIPPING_API_LEVEL>=28. _my_paths := \ - $(TARGET_COPY_OUT_ROOT) \ - $(TARGET_COPY_OUT_SYSTEM) \ + $(TARGET_COPY_OUT_ROOT)/ \ + $(TARGET_COPY_OUT_SYSTEM)/ \ $(call require-artifacts-in-path, $(_my_paths), $(_my_whitelist))