aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-04-09 01:04:12 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-04-09 01:04:12 +0000
commit3de9fa6182095bb2ebb5f0beacf1d547196c4a8b (patch)
treee7285a4717ab45f4d299319be9c0ecd14d9425e6
parentf5f1948f310ad4f77776423b8f99148055d991e1 (diff)
parentfb65e893468252d2ead03c2bfb34f4491700f754 (diff)
downloadbuild-3de9fa6182095bb2ebb5f0beacf1d547196c4a8b.tar.gz
Merge "Add a build flag to turn on debugfs restrictions" am: fb65e89346
Original change: https://android-review.googlesource.com/c/platform/build/+/1663700 Change-Id: Ica9bc063548b8ff11f6ba63ed2c369aa7b377a30
-rw-r--r--core/main.mk7
-rw-r--r--core/product.mk3
-rw-r--r--core/soong_config.mk2
3 files changed, 12 insertions, 0 deletions
diff --git a/core/main.mk b/core/main.mk
index cc9c809cd3..1e9a95f9fa 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -290,6 +290,13 @@ ADDITIONAL_VENDOR_PROPERTIES += \
ro.product.first_api_level=$(PRODUCT_SHIPPING_API_LEVEL)
endif
+ifneq ($(TARGET_BUILD_VARIANT),user)
+ ifdef PRODUCT_SET_DEBUGFS_RESTRICTIONS
+ ADDITIONAL_VENDOR_PROPERTIES += \
+ ro.product.enforce_debugfs_restrictions=$(PRODUCT_SET_DEBUGFS_RESTRICTIONS)
+ endif
+endif
+
# Vendors with GRF must define BOARD_SHIPPING_API_LEVEL for the vendor API level.
# This must not be defined for the non-GRF devices.
ifdef BOARD_SHIPPING_API_LEVEL
diff --git a/core/product.mk b/core/product.mk
index 7c27614eca..015fe44ba9 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -341,6 +341,9 @@ _product_list_vars += PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION
# This flag implies PRODUCT_USE_DYNAMIC_PARTITIONS.
_product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
+# When this is true, various build time as well as runtime debugfs restrictions are enabled.
+_product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS
+
# Other dynamic partition feature flags.PRODUCT_USE_DYNAMIC_PARTITION_SIZE and
# PRODUCT_BUILD_SUPER_PARTITION default to the value of PRODUCT_USE_DYNAMIC_PARTITIONS.
_product_single_value_vars += \
diff --git a/core/soong_config.mk b/core/soong_config.mk
index b87eba1080..17176df7f5 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -256,6 +256,8 @@ $(call add_json_bool, BuildBrokenEnforceSyspropOwner, $(filter true,$(BUILD_
$(call add_json_bool, BuildBrokenTrebleSyspropNeverallow, $(filter true,$(BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW)))
$(call add_json_bool, BuildBrokenVendorPropertyNamespace, $(filter true,$(BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE)))
+$(call add_json_bool, BuildDebugfsRestrictionsEnabled, $(filter true,$(PRODUCT_SET_DEBUGFS_RESTRICTIONS)))
+
$(call add_json_bool, RequiresInsecureExecmemForSwiftshader, $(filter true,$(PRODUCT_REQUIRES_INSECURE_EXECMEM_FOR_SWIFTSHADER)))
$(call add_json_bool, SelinuxIgnoreNeverallows, $(filter true,$(SELINUX_IGNORE_NEVERALLOWS)))