Merge "Add VENDOR_PRODUCT_RESTRICT_VENDOR_FILES"
This commit is contained in:
@@ -121,6 +121,10 @@ _product_var_list := \
|
|||||||
PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \
|
PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \
|
||||||
PRODUCT_DEX_PREOPT_BOOT_FLAGS \
|
PRODUCT_DEX_PREOPT_BOOT_FLAGS \
|
||||||
PRODUCT_SHIPPING_API_LEVEL \
|
PRODUCT_SHIPPING_API_LEVEL \
|
||||||
|
VENDOR_PRODUCT_RESTRICT_VENDOR_FILES \
|
||||||
|
VENDOR_EXCEPTION_MODULES \
|
||||||
|
VENDOR_EXCEPTION_PATHS \
|
||||||
|
|
||||||
|
|
||||||
define dump-product
|
define dump-product
|
||||||
$(info ==== $(1) ====)\
|
$(info ==== $(1) ====)\
|
||||||
|
@@ -46,19 +46,43 @@ _vendor_owner_whitelist := \
|
|||||||
widevine
|
widevine
|
||||||
|
|
||||||
|
|
||||||
ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))
|
_restrictions := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES))
|
||||||
|
|
||||||
_vendor_check_modules := $(product_MODULES)
|
ifneq (,$(_restrictions))
|
||||||
|
ifneq (,$(PRODUCTS.$(INTERNAL_PRODUCT).VENDOR_PRODUCT_RESTRICT_VENDOR_FILES))
|
||||||
|
$(error Error: cannot set both PRODUCT_RESTRICT_VENDOR_FILES and VENDOR_PRODUCT_RESTRICT_VENDOR_FILES)
|
||||||
|
endif
|
||||||
|
_vendor_exception_path_prefix :=
|
||||||
|
_vendor_exception_modules :=
|
||||||
|
else
|
||||||
|
_restrictions := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).VENDOR_PRODUCT_RESTRICT_VENDOR_FILES))
|
||||||
|
_vendor_exception_path_prefix := $(patsubst %, vendor/%/%, $(PRODUCTS.$(INTERNAL_PRODUCT).VENDOR_EXCEPTION_PATHS))
|
||||||
|
_vendor_exception_modules := $(PRODUCTS.$(INTERNAL_PRODUCT).VENDOR_EXCEPTION_MODULES)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
ifneq (,$(_restrictions))
|
||||||
|
|
||||||
|
_vendor_check_modules := \
|
||||||
|
$(foreach m, $(filter-out $(_vendor_exception_modules), $(product_MODULES)), \
|
||||||
|
$(if $(filter-out FAKE, $(ALL_MODULES.$(m).CLASS)),\
|
||||||
|
$(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\
|
||||||
|
$(if $(filter-out $(_vendor_exception_path_prefix), $(ALL_MODULES.$(m).PATH)),\
|
||||||
|
$(m)))))
|
||||||
|
|
||||||
_vendor_module_owner_info :=
|
_vendor_module_owner_info :=
|
||||||
# Restrict owners
|
# Restrict owners
|
||||||
ifneq (,$(filter true owner all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES)))
|
ifneq (,$(filter true owner all, $(_restrictions)))
|
||||||
|
|
||||||
ifneq (,$(filter vendor/%, $(PRODUCT_PACKAGE_OVERLAYS) $(DEVICE_PACKAGE_OVERLAYS)))
|
_vendor_package_overlays := $(filter-out $(_vendor_exception_path_prefix),\
|
||||||
$(error Error: Product "$(TARGET_PRODUCT)" cannot have overlay in vendor tree: \
|
|
||||||
$(filter vendor/%, $(PRODUCT_PACKAGE_OVERLAYS) $(DEVICE_PACKAGE_OVERLAYS)))
|
$(filter vendor/%, $(PRODUCT_PACKAGE_OVERLAYS) $(DEVICE_PACKAGE_OVERLAYS)))
|
||||||
|
ifneq (,$(_vendor_package_overlays))
|
||||||
|
$(error Error: Product "$(TARGET_PRODUCT)" cannot have overlay in vendor tree: $(_vendor_package_overlays))
|
||||||
endif
|
endif
|
||||||
_vendor_check_copy_files := $(filter vendor/%, $(PRODUCT_COPY_FILES))
|
_vendor_package_overlays :=
|
||||||
|
|
||||||
|
_vendor_check_copy_files := $(filter-out $(_vendor_exception_path_prefix),\
|
||||||
|
$(filter vendor/%, $(PRODUCT_COPY_FILES)))
|
||||||
ifneq (,$(_vendor_check_copy_files))
|
ifneq (,$(_vendor_check_copy_files))
|
||||||
$(foreach c, $(_vendor_check_copy_files), \
|
$(foreach c, $(_vendor_check_copy_files), \
|
||||||
$(if $(filter $(_vendor_owner_whitelist), $(call word-colon,3,$(c))),,\
|
$(if $(filter $(_vendor_owner_whitelist), $(call word-colon,3,$(c))),,\
|
||||||
@@ -68,28 +92,24 @@ endif
|
|||||||
_vendor_check_copy_files :=
|
_vendor_check_copy_files :=
|
||||||
|
|
||||||
$(foreach m, $(_vendor_check_modules), \
|
$(foreach m, $(_vendor_check_modules), \
|
||||||
$(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\
|
$(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\
|
||||||
$(if $(filter-out FAKE, $(ALL_MODULES.$(m).CLASS)),\
|
$(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \
|
||||||
$(if $(filter $(_vendor_owner_whitelist), $(ALL_MODULES.$(m).OWNER)),,\
|
"$(ALL_MODULES.$(m).OWNER)" in product "$(TARGET_PRODUCT)"))\
|
||||||
$(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) with unknown owner \
|
$(if $(ALL_MODULES.$(m).INSTALLED),\
|
||||||
"$(ALL_MODULES.$(m).OWNER)" in product "$(TARGET_PRODUCT)"))\
|
$(eval _vendor_module_owner_info += $(patsubst $(PRODUCT_OUT)/%,%,$(ALL_MODULES.$(m).INSTALLED)):$(ALL_MODULES.$(m).OWNER))))
|
||||||
$(if $(ALL_MODULES.$(m).INSTALLED),\
|
|
||||||
$(eval _vendor_module_owner_info += $(patsubst $(PRODUCT_OUT)/%,%,$(ALL_MODULES.$(m).INSTALLED)):$(ALL_MODULES.$(m).OWNER))))))
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Restrict paths
|
# Restrict paths
|
||||||
ifneq (,$(filter path all, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_RESTRICT_VENDOR_FILES)))
|
ifneq (,$(filter path all, $(_restrictions)))
|
||||||
|
|
||||||
$(foreach m, $(_vendor_check_modules), \
|
$(foreach m, $(_vendor_check_modules), \
|
||||||
$(if $(filter vendor/%, $(ALL_MODULES.$(m).PATH)),\
|
$(if $(filter-out ,$(ALL_MODULES.$(m).INSTALLED)),\
|
||||||
$(if $(filter-out FAKE, $(ALL_MODULES.$(m).CLASS)),\
|
$(if $(filter $(TARGET_OUT_VENDOR)/% $(TARGET_OUT_ODM)/% $(HOST_OUT)/%, $(ALL_MODULES.$(m).INSTALLED)),,\
|
||||||
$(if $(filter-out ,$(ALL_MODULES.$(m).INSTALLED)),\
|
$(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) \
|
||||||
$(if $(filter $(TARGET_OUT_VENDOR)/% $(HOST_OUT)/%, $(ALL_MODULES.$(m).INSTALLED)),,\
|
in product "$(TARGET_PRODUCT)" being installed to \
|
||||||
$(error Error: vendor module "$(m)" in $(ALL_MODULES.$(m).PATH) \
|
$(ALL_MODULES.$(m).INSTALLED) which is not in the vendor tree or odm tree))))
|
||||||
in product "$(TARGET_PRODUCT)" being installed to \
|
|
||||||
$(ALL_MODULES.$(m).INSTALLED) which is not in the vendor tree))))))
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -112,4 +132,7 @@ $(call dist-for-goals, droidcore, $(_vendor_module_owner_info_txt))
|
|||||||
_vendor_module_owner_info_txt :=
|
_vendor_module_owner_info_txt :=
|
||||||
_vendor_module_owner_info :=
|
_vendor_module_owner_info :=
|
||||||
_vendor_check_modules :=
|
_vendor_check_modules :=
|
||||||
|
_vendor_exception_path_prefix :=
|
||||||
|
_vendor_exception_modules :=
|
||||||
|
_restrictions :=
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user