audit2allow: execute selinux tools from prebuilts

Instead of moving audit2allow into out directory, run directly from
selinux/prebuilts. Include path in build/envsetup.sh

Includes some general cleanup of the file structure.

Bug: 21724977
Change-Id: Ide320a56b9cdbfa426b978443f6df07fa2a38fbc
This commit is contained in:
Jeff Vander Stoep 2015-06-12 09:43:19 -07:00
parent a34377d480
commit 24f9ffc478
26 changed files with 21 additions and 30 deletions

View file

@ -1 +1 @@
include $(call all-named-subdir-makefiles, libsepol checkpolicy prebuilts)
include $(call all-named-subdir-makefiles, libsepol checkpolicy)

View file

@ -1,21 +0,0 @@
ifeq ($(HOST_OS), linux)
LOCAL_PATH:= $(call my-dir)
##
# libselinux.so host prebuilt
#
include $(CLEAR_VARS)
LOCAL_PREBUILT_LIBS := lib/libselinux.so.1
include $(BUILD_HOST_PREBUILT)
##
# audit2allow/audit2why prebuilt
# Shell wrapper that sets the LD_LIBRARY_PATH and calls the
# audit2allow/why python script
#
include $(CLEAR_VARS)
LOCAL_PREBUILT_EXECUTABLES := usr/bin/audit2allow \
usr/bin/audit2why
include $(BUILD_HOST_PREBUILT)
endif # ($(HOST_OS), linux)

10
prebuilts/bin/audit2allow Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
unamestr=`uname`
if [[ $unamestr == "Linux" ]]; then
export LD_LIBRARY_PATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/lib
export PYTHONPATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/lib
python $ANDROID_BUILD_TOP/external/selinux/policycoreutils/audit2allow/audit2allow "$@"
else
echo "audit2allow is only supported on linux"
fi

10
prebuilts/bin/audit2why Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
unamestr=`uname`
if [[ $unamestr == "Linux" ]]; then
export LD_LIBRARY_PATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/lib
export PYTHONPATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/lib
python $ANDROID_BUILD_TOP/external/selinux/policycoreutils/audit2allow/audit2wy "$@"
else
echo "audit2why is only supported on linux"
fi

View file

@ -1,4 +0,0 @@
#!/bin/sh
export LD_LIBRARY_PATH=$ANDROID_HOST_OUT/lib64
export PYTHONPATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/usr/lib/python2.7/site-packages
python $ANDROID_BUILD_TOP/external/selinux/policycoreutils/audit2allow/audit2allow "$@"

View file

@ -1,4 +0,0 @@
#!/bin/sh
export LD_LIBRARY_PATH=$ANDROID_HOST_OUT/lib64
export PYTHONPATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/usr/lib/python2.7/site-packages
python $ANDROID_BUILD_TOP/external/selinux/policycoreutils/audit2allow/audit2why "$@"