blob: 22213733bd90843188a84160f7e95555adc16dce [file] [log] [blame]
#!/bin/sh
if [ -z "${HOST_OUT_EXECUTABLES}" ]; then
echo 'HOST_OUT_EXECUTABLES not set. Some error with make setup?'
exit 1
elif [ -z "${ANDROID_BUILD_TOP}" ]; then
echo 'ANDROID_BUILD_TOP not set. Have you run lunch?'
exit 1
elif [ ! -f "$HOST_OUT_EXECUTABLES/lib64/libselinux.so" ]; then
echo "Cannot find $HOST_OUT_EXECUTABLES/lib64/libselinux.so"
echo "Need to build project"
exit 1
fi
unamestr=`uname`
if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
export LD_PRELOAD=$HOST_OUT_EXECUTABLES/lib64/libselinux.so
export PYTHONPATH=$ANDROID_BUILD_TOP/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages
exec python $ANDROID_BUILD_TOP/external/selinux/python/audit2allow/audit2why "$@"
else
echo "audit2why is only supported on linux"
exit 1
fi