toolbox_recovery should always include setenforce
init does not follow symlinks and we need setenforce to be able
to set permissive. toolbox_recovery will now always include the
setenforce tool even if busybox has it so that our provided
init.rc can run /sbin/toolbox setenforce 0 successfully. The
symlink for setenforce will remain pointing to busybox if busybox
has setenforce.
Change-Id: I88a2a99bbed30cef3443ac5d94665e3850872237
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index a08e78d..93e96a8 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -107,7 +107,7 @@
OUR_TOOLS += r
endif
-ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS)
+ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) setenforce
LOCAL_SRC_FILES := \
upstream-netbsd/lib/libc/gen/getbsize.c \
@@ -120,6 +120,10 @@
$(patsubst %,%.c,$(OUR_TOOLS)) \
toolbox.c \
+ifeq (,$(filter $(LOCAL_SRC_FILES),setenforce.c))
+ LOCAL_SRC_FILES += setenforce.c
+endif
+
LOCAL_CFLAGS += $(common_cflags)
LOCAL_C_INCLUDES += external/openssl/include