Christopher R. Palmer | 070fcfc | 2017-03-03 09:27:58 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2016 The CyanogenMod Project |
| 4 | # Copyright (C) 2017 The LineageOS Project |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | |
| 19 | set -e |
| 20 | |
| 21 | DEVICE=**** FILL IN DEVICE NAME **** |
| 22 | VENDOR=*** FILL IN VENDOR **** |
| 23 | |
| 24 | # Load extract_utils and do some sanity checks |
| 25 | MY_DIR="${BASH_SOURCE%/*}" |
| 26 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi |
| 27 | |
| 28 | CM_ROOT="$MY_DIR"/../../.. |
| 29 | |
| 30 | HELPER="$CM_ROOT"/vendor/cm/build/tools/extract_utils.sh |
| 31 | if [ ! -f "$HELPER" ]; then |
| 32 | echo "Unable to find helper script at $HELPER" |
| 33 | exit 1 |
| 34 | fi |
| 35 | . "$HELPER" |
| 36 | |
| 37 | if [ $# -eq 0 ]; then |
| 38 | SRC=adb |
| 39 | else |
| 40 | if [ $# -eq 1 ]; then |
| 41 | SRC=$1 |
| 42 | else |
| 43 | echo "$0: bad number of arguments" |
| 44 | echo "" |
| 45 | echo "usage: $0 [PATH_TO_EXPANDED_ROM]" |
| 46 | echo "" |
| 47 | echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from" |
| 48 | echo "the device using adb pull." |
| 49 | exit 1 |
| 50 | fi |
| 51 | fi |
| 52 | |
| 53 | # Initialize the helper |
| 54 | setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" |
| 55 | |
| 56 | extract "$MY_DIR"/proprietary-files.txt "$SRC" |
| 57 | |
| 58 | "$MY_DIR"/setup-makefiles.sh |