summaryrefslogtreecommitdiffstats
path: root/toolbox/Android.mk
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--toolbox/Android.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index d54bfa440..4698cd250 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -1,3 +1,4 @@
+TWRP_TOOLBOX_PATH := $(call my-dir)
LOCAL_PATH := system/core/toolbox
include $(CLEAR_VARS)
@@ -212,6 +213,19 @@ ifneq (,$(filter $(PLATFORM_SDK_VERSION), 21 22 23))
LOCAL_WHOLE_STATIC_LIBRARIES := $(patsubst %,libtoolbox_%,$(BSD_TOOLS))
endif
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
+ # Rule to make getprop and setprop in M trees where toybox normally
+ # provides these tools. Toybox does not allow for easy dynamic
+ # configuration, so we would have to include the entire toybox binary
+ # which takes up more space than is necessary so long as we are still
+ # including busybox.
+ LOCAL_SRC_FILES += \
+ ../../../$(TWRP_TOOLBOX_PATH)/dynarray.c \
+ ../../../$(TWRP_TOOLBOX_PATH)/getprop.c \
+ ../../../$(TWRP_TOOLBOX_PATH)/setprop.c
+ OUR_TOOLS += getprop setprop
+endif
+
LOCAL_MODULE := toolbox_recovery
LOCAL_MODULE_STEM := toolbox
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin