Improve selinux utils wrappers am: d72d78d969

am: 6ff047f744

Change-Id: I2bdf37080f14684eff19d25a278410509626dcdb
This commit is contained in:
Brian Murray 2017-06-26 22:02:49 +00:00 committed by android-build-merger
commit bda8c317b2
4 changed files with 38 additions and 0 deletions

View file

@ -1,5 +1,17 @@
#!/bin/sh
if [ -z "${ANDROID_HOST_OUT}" ]; then
echo 'ANDROID_HOST_OUT not set. Have you run lunch?'
exit 1
elif [ -z "${ANDROID_BUILD_TOP}" ]; then
echo 'ANDROID_BUILD_TOP not set. Have you run lunch?'
exit 1
elif [ ! -f "$ANDROID_HOST_OUT/lib64/libselinux.so" ]; then
echo "Cannot find $ANDROID_HOST_OUT/lib64/libselinux.so"
echo "Need to build project"
exit 1
fi
unamestr=`uname`
if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
export LD_PRELOAD=$ANDROID_HOST_OUT/lib64/libselinux.so
@ -7,4 +19,5 @@ if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
python $ANDROID_BUILD_TOP/external/selinux/python/audit2allow/audit2allow "$@"
else
echo "audit2allow is only supported on linux"
exit 1
fi

View file

@ -1,5 +1,17 @@
#!/bin/sh
if [ -z "${ANDROID_HOST_OUT}" ]; then
echo 'ANDROID_HOST_OUT not set. Have you run lunch?'
exit 1
elif [ -z "${ANDROID_BUILD_TOP}" ]; then
echo 'ANDROID_BUILD_TOP not set. Have you run lunch?'
exit 1
elif [ ! -f "$ANDROID_HOST_OUT/lib64/libselinux.so" ]; then
echo "Cannot find $ANDROID_HOST_OUT/lib64/libselinux.so"
echo "Need to build project"
exit 1
fi
unamestr=`uname`
if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
export LD_PRELOAD=$ANDROID_HOST_OUT/lib64/libselinux.so
@ -7,4 +19,5 @@ if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
exec python $ANDROID_BUILD_TOP/external/selinux/python/audit2allow/audit2why "$@"
else
echo "audit2why is only supported on linux"
exit 1
fi

View file

@ -1,9 +1,15 @@
#!/bin/sh
if [ -z "${ANDROID_BUILD_TOP}" ]; then
echo 'ANDROID_BUILD_TOP not set. Have you run lunch?'
exit 1
fi
unamestr=`uname`
if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
export PYTHONPATH=$ANDROID_BUILD_TOP/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages
python $ANDROID_BUILD_TOP/external/selinux/prebuilts/bin/sediff.py "$@"
else
echo "sediff is only supported on linux"
exit 1
fi

View file

@ -1,5 +1,10 @@
#!/bin/sh
if [ -z "${ANDROID_BUILD_TOP}" ]; then
echo 'ANDROID_BUILD_TOP not set. Have you run lunch?'
exit 1
fi
unamestr=`uname`
if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
export LD_LIBRARY_PATH=$ANDROID_BUILD_TOP/external/selinux/prebuilts/lib
@ -7,4 +12,5 @@ if [ "$unamestr" = "Linux" -o "$unamestr" = "linux" ]; then
exec python $ANDROID_BUILD_TOP/external/selinux/prebuilts/bin/seinfo.py "$@"
else
echo "seinfo is only supported on linux"
exit 1
fi