build libcamera_metadata from source
[GitHub/mt8127/android_device_alcatel_ttab.git] / extract-files.sh
CommitLineData
f3fa1980
S
1#!/bin/bash
2
3set -e
4
5VENDOR=alcatel
6DEVICE=ttab
7
8function extract() {
9 for FILE in `egrep -v '(^#|^$)' $1`; do
10 OLDIFS=$IFS IFS=":" PARSING_ARRAY=($FILE) IFS=$OLDIFS
11 FILE=`echo ${PARSING_ARRAY[0]} | sed -e "s/^-//g"`
12 DEST=${PARSING_ARRAY[1]}
13 if [ -z $DEST ]; then
14 DEST=$FILE
15 fi
16 DIR=`dirname $FILE`
17 if [ ! -d $2/$DIR ]; then
18 mkdir -p $2/$DIR
19 fi
20 if [ "$SRC" = "adb" ]; then
21 # Try CM target first
22 adb pull /system/$DEST $2/$DEST
23 # if file does not exist try OEM target
24 if [ "$?" != "0" ]; then
25 adb pull /system/$FILE $2/$DEST
26 fi
27 else
28 cp $SRC/system/$FILE $2/$DEST
29 # if file dot not exist try destination
30 if [ "$?" != "0" ]
31 then
32 cp $SRC/system/$DEST $2/$DEST
33 fi
34 fi
35 done
36}
37
38if [ $# -eq 0 ]; then
39 SRC=adb
40else
41 if [ $# -eq 1 ]; then
42 SRC=$1
43 else
44 echo "$0: bad number of arguments"
45 echo ""
46 echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
47 echo ""
48 echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
49 echo "the device using adb pull."
50 exit 1
51 fi
52fi
53
54DEVBASE=../../../vendor/$VENDOR/$DEVICE/proprietary
55rm -rf $DEVBASE/*
56
57extract ../../$VENDOR/$DEVICE/proprietary-files.txt $DEVBASE
58
59./setup-makefiles.sh