aboutsummaryrefslogtreecommitdiff
path: root/shim/sl/scripts/modify_aosp_libs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'shim/sl/scripts/modify_aosp_libs.sh')
-rwxr-xr-xshim/sl/scripts/modify_aosp_libs.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/shim/sl/scripts/modify_aosp_libs.sh b/shim/sl/scripts/modify_aosp_libs.sh
index 104e99105e..f2fc5c1937 100755
--- a/shim/sl/scripts/modify_aosp_libs.sh
+++ b/shim/sl/scripts/modify_aosp_libs.sh
@@ -1,21 +1,31 @@
#!/usr/bin/env bash
+AOSP_WORKING_DIR=$1
+
+if [ "$#" -ne 1 ]; then
+
+ echo "Usage: This script must be passed a single parameter which is a path "
+ echo " to an existing directory where the AOSP repo's have been cloned."
+ echo "Error: No working directory path parameter provided."
+ exit 1
+fi
+if [ ! -d "$1" ]; then
+
+ echo "Usage: This script must be passed a single parameter which is a path "
+ echo " to an existing directory where the AOSP repo's have been cloned."
+ echo "Error: Working directory path provided is not a directory."
+ exit 1
+fi
+
SCRIPT_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
echo "SCRIPT_PATH= ${SCRIPT_PATH}"
-AOSP_DIR="${SCRIPT_PATH}/../aosp/"
-echo "AOSP_DIR= ${AOSP_DIR}"
-pushd "${AOSP_DIR}/system/libbase/"
+pushd "${AOSP_WORKING_DIR}/system/libbase/"
echo "Applying libbase logging.cpp patch"
git apply "${SCRIPT_PATH}/libbase_logging_cpp.patch"
popd
-pushd "${AOSP_DIR}/packages/modules/NeuralNetworks/"
+pushd "${AOSP_WORKING_DIR}/packages/modules/NeuralNetworks/"
echo "Applying NeuralNetworks patch"
git apply "${SCRIPT_PATH}/NeuralNetworks.patch"
popd
-
-pushd "${SCRIPT_PATH}/.."
- echo "Renaming Android.mk and Android.bp to .DISABLED for NDK build only"
- find ./aosp -name "*.bp" -exec bash -c 'mv "$1" "${1%.bp}".bp.DISABLED' - '{}' \;
-popd