blob: d09d2fdc31bf6bf5ced736f9baf401dac6af4a56 [file] [log] [blame]
Christopher R. Palmer070fcfc2017-03-03 09:27:58 -05001#!/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
19set -e
20
21DEVICE=**** FILL IN DEVICE NAME ****
22VENDOR=*** FILL IN VENDOR ****
23
24# Load extract_utils and do some sanity checks
25MY_DIR="${BASH_SOURCE%/*}"
26if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
27
28CM_ROOT="$MY_DIR"/../../..
29
30HELPER="$CM_ROOT"/vendor/cm/build/tools/extract_utils.sh
31if [ ! -f "$HELPER" ]; then
32 echo "Unable to find helper script at $HELPER"
33 exit 1
34fi
35. "$HELPER"
36
37if [ $# -eq 0 ]; then
38 SRC=adb
39else
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
51fi
52
53# Initialize the helper
54setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
55
56extract "$MY_DIR"/proprietary-files.txt "$SRC"
57
58"$MY_DIR"/setup-makefiles.sh