1#!/bin/sh
2
3# Copyright 2014 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17rm -f extract-lists.txt
18cat ../vendor_owner_info.txt |
19cut -d : -f 2 |
20sort -u |
21#grep -v google |
22while read target_owner
23do
24mkdir -p $target_owner/staging
25cat > $target_owner/staging/device-partial.mk << EOF
26# Copyright 2014 The Android Open Source Project
27#
28# Licensed under the Apache License, Version 2.0 (the "License");
29# you may not use this file except in compliance with the License.
30# You may obtain a copy of the License at
31#
32#      http://www.apache.org/licenses/LICENSE-2.0
33#
34# Unless required by applicable law or agreed to in writing, software
35# distributed under the License is distributed on an "AS IS" BASIS,
36# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37# See the License for the specific language governing permissions and
38# limitations under the License.
39
40EOF
41echo -n "# " >> $target_owner/staging/device-partial.mk
42case $target_owner in
43asus)
44echo -n Asus >> $target_owner/staging/device-partial.mk
45;;
46broadcom)
47echo -n Broadcom >> $target_owner/staging/device-partial.mk
48;;
49google)
50echo -n Google >> $target_owner/staging/device-partial.mk
51;;
52intel)
53echo -n Intel >> $target_owner/staging/device-partial.mk
54;;
55widevine)
56echo -n Widevine >> $target_owner/staging/device-partial.mk
57;;
58esac
59echo " blob(s) necessary for Fugu hardware" >> $target_owner/staging/device-partial.mk
60echo "PRODUCT_COPY_FILES := \\" >> $target_owner/staging/device-partial.mk
61
62echo "  $target_owner)" >> extract-lists.txt
63echo "    TO_EXTRACT=\"\\" >> extract-lists.txt
64
65
66cat ../proprietary-blobs.txt |
67grep ^/ |
68cut -b 2- |
69sort |
70while read file
71do
72
73auto_owner=$(grep ^$file: ../vendor_owner_info.txt | cut -d : -f 2)
74if test $file = system/lib/hw/gps.msm8974.so -o $file = system/lib/libgps.utils.so -o $file = system/lib/libloc_adapter.so -o $file = system/lib/libloc_eng.so
75then
76auto_owner=qcom
77fi
78
79if test "$auto_owner" = ""
80then
81echo $file has no known owner
82fi
83
84if test "$auto_owner" = "$target_owner" -a $file != system/app/shutdownlistener.apk -a $file != system/app/TimeService.apk
85then
86if test $file != ZZZ
87then
88  if [[ $file == *.apk ]]
89  then
90    echo "            $file \\" >> extract-lists.txt
91    continue
92  fi
93
94  if [[ $file == */lib64/* ]]
95  then
96    echo "    vendor/$target_owner/fugu/proprietary/lib64/$(basename $file):$file:$target_owner \\" >> $target_owner/staging/device-partial.mk
97  elif [[ $file == */arm/nb/* ]]
98  then
99    echo "    vendor/$target_owner/fugu/proprietary/armnb/$(basename $file):$file:$target_owner \\" >> $target_owner/staging/device-partial.mk
100  else
101    echo "    vendor/$target_owner/fugu/proprietary/$(basename $file):$file:$target_owner \\" >> $target_owner/staging/device-partial.mk
102  fi
103fi
104echo "            $file \\" >> extract-lists.txt
105fi
106done
107
108echo >> $target_owner/staging/device-partial.mk
109if test $target_owner = qcom
110then
111true ; #echo PRODUCT_PACKAGES := libacdbloader >> $target_owner/staging/device-partial.mk
112fi
113
114echo "            \"" >> extract-lists.txt
115echo "    ;;" >> extract-lists.txt
116done
117