Home | History | Annotate | Download | only in self-extractors
      1 #!/bin/sh
      2 
      3 # Copyright 2013 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 
     17 rm -f extract-lists.txt
     18 cat ../vendor_owner_info.txt |
     19 cut -d : -f 2 |
     20 sort -u |
     21 grep -v google |
     22 while read target_owner
     23 do
     24 cat > $target_owner/staging/device-partial.mk << EOF
     25 # Copyright 2013 The Android Open Source Project
     26 #
     27 # Licensed under the Apache License, Version 2.0 (the "License");
     28 # you may not use this file except in compliance with the License.
     29 # You may obtain a copy of the License at
     30 #
     31 #      http://www.apache.org/licenses/LICENSE-2.0
     32 #
     33 # Unless required by applicable law or agreed to in writing, software
     34 # distributed under the License is distributed on an "AS IS" BASIS,
     35 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     36 # See the License for the specific language governing permissions and
     37 # limitations under the License.
     38 
     39 EOF
     40 echo -n "# " >> $target_owner/staging/device-partial.mk
     41 case $target_owner in
     42 broadcom)
     43 echo -n Broadcom >> $target_owner/staging/device-partial.mk
     44 ;;
     45 lge)
     46 echo -n LGE >> $target_owner/staging/device-partial.mk
     47 ;;
     48 qcom)
     49 echo -n Qualcomm >> $target_owner/staging/device-partial.mk
     50 ;;
     51 esac
     52 echo " blob(s) necessary for Mako hardware" >> $target_owner/staging/device-partial.mk
     53 echo "PRODUCT_COPY_FILES := \\" >> $target_owner/staging/device-partial.mk
     54 
     55 echo "  $target_owner)" >> extract-lists.txt
     56 echo "    TO_EXTRACT=\"\\" >> extract-lists.txt
     57 
     58 
     59 cat ../proprietary-blobs.txt |
     60 grep ^/ |
     61 cut -b 2- |
     62 sort |
     63 while read file
     64 do
     65 
     66 auto_owner=$(grep ^$file: ../vendor_owner_info.txt | cut -d : -f 2)
     67 if test $file = system/lib/hw/gps.msm8960.so -o $file = system/lib/libgps.utils.so -o $file = system/lib/libloc_adapter.so -o $file = system/lib/libloc_eng.so
     68 then
     69 auto_owner=qcom
     70 fi
     71 
     72 if test "$auto_owner" = "" -a $file != system/etc/firmware/wcd9310/wcd9310_anc.bin -a $file != system/etc/firmware/wcd9310/wcd9310_mbhc.bin
     73 then
     74 echo $file has no known owner
     75 fi
     76 
     77 if test "$auto_owner" = "$target_owner"
     78 then
     79 if test $file != system/lib/libacdbloader.so
     80 then
     81 echo "    vendor/$target_owner/mako/proprietary/$(basename $file):$file:$target_owner \\" >> $target_owner/staging/device-partial.mk
     82 fi
     83 echo "            $file \\" >> extract-lists.txt
     84 fi
     85 done
     86 
     87 echo >> $target_owner/staging/device-partial.mk
     88 if test $target_owner = qcom
     89 then
     90 echo PRODUCT_PACKAGES := libacdbloader >> $target_owner/staging/device-partial.mk
     91 fi
     92 
     93 echo "            \"" >> extract-lists.txt
     94 echo "    ;;" >> extract-lists.txt
     95 done
     96