blob: 9d13cb015c6c04817177c44f0bf4ec2b2dc4a8f4 [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
Rashed Abdel-Tawab58ce8252017-07-30 14:09:24 -040037# default to not sanitizing the vendor folder before extraction
38clean_vendor=false
39
40while [ "$1" != "" ]; do
41 case $1 in
42 -p | --path ) shift
43 SRC=$1
44 ;;
45 -s | --section ) shift
46 SECTION=$1
47 clean_vendor=false
48 ;;
49 -c | --clean-vendor ) clean_vendor=true
50 ;;
51 esac
52 shift
53done
54
55if [ -z "$SRC" ]; then
Christopher R. Palmer070fcfc2017-03-03 09:27:58 -050056 SRC=adb
Christopher R. Palmer070fcfc2017-03-03 09:27:58 -050057fi
58
59# Initialize the helper
Rashed Abdel-Tawab58ce8252017-07-30 14:09:24 -040060setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false $clean_vendor
Christopher R. Palmer070fcfc2017-03-03 09:27:58 -050061
Rashed Abdel-Tawab58ce8252017-07-30 14:09:24 -040062extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
Christopher R. Palmer070fcfc2017-03-03 09:27:58 -050063
64"$MY_DIR"/setup-makefiles.sh