diff options
Diffstat (limited to 'toolbox')
-rw-r--r-- | toolbox/Android.mk | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk index 4c3e433c2..916080213 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -18,28 +18,26 @@ endif # If busybox does not have SELinux support, provide these tools with toolbox. # Note that RECOVERY_BUSYBOX_TOOLS will be empty if TW_USE_TOOLBOX == true. -ifeq ($(TWHAVE_SELINUX), true) - TOOLS_FOR_SELINUX := \ - ls +TOOLS_FOR_SELINUX := \ + ls - ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) - TOOLS_FOR_SELINUX += \ - load_policy \ - getenforce \ - chcon \ - restorecon \ - runcon \ - getsebool \ - setsebool - endif +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) + TOOLS_FOR_SELINUX += \ + load_policy \ + getenforce \ + chcon \ + restorecon \ + runcon \ + getsebool \ + setsebool +endif - OUR_TOOLS += $(filter-out $(RECOVERY_BUSYBOX_TOOLS), $(TOOLS_FOR_SELINUX)) +OUR_TOOLS += $(filter-out $(RECOVERY_BUSYBOX_TOOLS), $(TOOLS_FOR_SELINUX)) - # toolbox setenforce is used during init, so it needs to be included here - # symlink is omitted at the very end if busybox already provides this - ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) - OUR_TOOLS += setenforce - endif +# toolbox setenforce is used during init, so it needs to be included here +# symlink is omitted at the very end if busybox already provides this +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) + OUR_TOOLS += setenforce endif ifeq ($(TW_USE_TOOLBOX), true) @@ -50,26 +48,29 @@ ifeq ($(TW_USE_TOOLBOX), true) du \ OUR_TOOLS := \ - df \ iftop \ ioctl \ - ionice \ log \ - ls \ - lsof \ - mount \ nandread \ newfs_msdos \ ps \ prlimit \ - renice \ sendevent \ start \ stop \ top \ - uptime \ - watchprops \ + ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 25; echo $$?),0) + OUR_TOOLS += \ + df \ + ionice \ + ls \ + lsof \ + mount \ + renice \ + uptime \ + watchprops + endif else ifneq (,$(filter $(PLATFORM_SDK_VERSION), 21 22)) OUR_TOOLS += \ @@ -150,9 +151,6 @@ ifeq ($(TW_USE_TOOLBOX), true) vmstat \ watchprops \ wipe - ifneq ($(TWHAVE_SELINUX), true) - OUR_TOOLS += ls - endif endif endif @@ -206,9 +204,7 @@ else liblog endif -ifeq ($(TWHAVE_SELINUX), true) - LOCAL_SHARED_LIBRARIES += libselinux -endif +LOCAL_SHARED_LIBRARIES += libselinux ifneq (,$(filter $(PLATFORM_SDK_VERSION), 21 22 23)) # libusbhost is only used by lsusb, and that isn't usually included in toolbox. @@ -217,7 +213,7 @@ 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) +ifneq (,$(filter $(PLATFORM_SDK_VERSION), 23 24)) # 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 @@ -262,13 +258,11 @@ $(TOOLS_H): $(LOCAL_PATH)/Android.mk $(TOOLS_H): $(transform-generated-source) -ifeq ($(TWHAVE_SELINUX), true) - # toolbox setenforce is used during init in non-symlink form, so it was - # required to be included as part of the suite above. if busybox already - # provides setenforce, we can omit the toolbox symlink - TEMP_TOOLS := $(filter-out $(RECOVERY_BUSYBOX_TOOLS), $(ALL_TOOLS)) - ALL_TOOLS := $(TEMP_TOOLS) -endif +# toolbox setenforce is used during init in non-symlink form, so it was +# required to be included as part of the suite above. if busybox already +# provides setenforce, we can omit the toolbox symlink +TEMP_TOOLS := $(filter-out $(RECOVERY_BUSYBOX_TOOLS), $(ALL_TOOLS)) +ALL_TOOLS := $(TEMP_TOOLS) # Make /sbin/toolbox launchers for each tool SYMLINKS := $(addprefix $(TARGET_RECOVERY_ROOT_OUT)/sbin/,$(ALL_TOOLS)) |