zenfone7: Import proprietary files from sm8250-common
Change-Id: I24a2e48a4c4b0a4c3476cb4404c82f14136ba93e
diff --git a/extract-files.sh b/extract-files.sh
index 9dd14df..c736f98 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -18,11 +18,48 @@
set -e
-# Required!
-export DEVICE=zenfone7
-export DEVICE_COMMON=sm8250-common
-export VENDOR=asus
+DEVICE=zenfone7
+VENDOR=asus
-export DEVICE_BRINGUP_YEAR=2020
+# Load extractutils and do some sanity checks
+MY_DIR="${BASH_SOURCE%/*}"
+if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
-"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"
+CM_ROOT="$MY_DIR"/../../..
+
+HELPER="$CM_ROOT"/vendor/omni/build/tools/extract_utils.sh
+if [ ! -f "$HELPER" ]; then
+ echo "Unable to find helper script at $HELPER"
+ exit 1
+fi
+. "$HELPER"
+
+# Default to sanitizing the vendor folder before extraction
+CLEAN_VENDOR=true
+
+while [ "$1" != "" ]; do
+ case $1 in
+ -p | --path ) shift
+ SRC=$1
+ ;;
+ -s | --section ) shift
+ SECTION=$1
+ CLEAN_VENDOR=false
+ ;;
+ -n | --no-cleanup ) CLEAN_VENDOR=false
+ ;;
+ esac
+ shift
+done
+
+if [ -z "$SRC" ]; then
+ SRC=adb
+fi
+
+# Initialize the helper
+setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false "$CLEAN_VENDOR"
+
+extract "$MY_DIR"/proprietary-files-product.txt "$SRC" "$SECTION"
+extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
+
+"$MY_DIR"/setup-makefiles.sh