1#!/bin/sh 2 3# Copyright (C) 2010 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(cd ../../../../out/target/product/panda ; zip -r ../../../../device/ti/panda/self-extractors/full_panda-pseudo_ota.zip system) 18 19ZIP=full_panda-pseudo_ota.zip 20BUILD=20120807 21ROOTDEVICE=panda 22DEVICE=panda 23MANUFACTURER=ti 24 25for COMPANY in imgtec 26do 27 echo Processing files from $COMPANY 28 rm -rf tmp 29 FILEDIR=tmp/vendor/$COMPANY/$DEVICE/proprietary 30 mkdir -p $FILEDIR 31 mkdir -p tmp/vendor/$MANUFACTURER/$ROOTDEVICE 32 case $COMPANY in 33 imgtec) 34 TO_EXTRACT="\ 35 system/vendor/bin/pvrsrvctl \ 36 system/vendor/lib/egl/libEGL_POWERVR_SGX540_120.so \ 37 system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so \ 38 system/vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so \ 39 system/vendor/lib/hw/gralloc.omap4.so \ 40 system/vendor/lib/libglslcompiler.so \ 41 system/vendor/lib/libIMGegl.so \ 42 system/vendor/lib/libpvr2d.so \ 43 system/vendor/lib/libpvrANDROID_WSEGL.so \ 44 system/vendor/lib/libPVRScopeServices.so \ 45 system/vendor/lib/libsrv_init.so \ 46 system/vendor/lib/libsrv_um.so \ 47 system/vendor/lib/libusc.so \ 48 " 49 ;; 50 esac 51 echo \ \ Extracting files from OTA package 52 for ONE_FILE in $TO_EXTRACT 53 do 54 echo \ \ \ \ Extracting $ONE_FILE 55 unzip -j -o $ZIP $ONE_FILE -d $FILEDIR > /dev/null || echo \ \ \ \ Error extracting $ONE_FILE 56 if test $ONE_FILE = system/vendor/bin/gpsd -o $ONE_FILE = system/vendor/bin/pvrsrvinit 57 then 58 chmod a+x $FILEDIR/$(basename $ONE_FILE) || echo \ \ \ \ Error chmoding $ONE_FILE 59 fi 60 done 61 echo \ \ Setting up $COMPANY-specific makefiles 62 cp -R $COMPANY/staging/* tmp/vendor/$COMPANY/$DEVICE || echo \ \ \ \ Error copying makefiles 63 echo \ \ Setting up shared makefiles 64 cp -R root/* tmp/vendor/$MANUFACTURER/$ROOTDEVICE || echo \ \ \ \ Error copying makefiles 65 echo \ \ Generating self-extracting script 66 SCRIPT=extract-$COMPANY-$DEVICE.sh 67 cat PROLOGUE > tmp/$SCRIPT || echo \ \ \ \ Error generating script 68 cat $COMPANY/COPYRIGHT >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 69 cat PART1 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 70 cat $COMPANY/LICENSE >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 71 cat PART2 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 72 echo tail -n +$(expr 2 + $(cat PROLOGUE $COMPANY/COPYRIGHT PART1 $COMPANY/LICENSE PART2 PART3 | wc -l)) \$0 \| tar zxv >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 73 cat PART3 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 74 (cd tmp ; tar zc --owner=root --group=root vendor/ >> $SCRIPT || echo \ \ \ \ Error generating embedded tgz) 75 chmod a+x tmp/$SCRIPT || echo \ \ \ \ Error generating script 76 ARCHIVE=$COMPANY-$DEVICE-$BUILD-$(md5sum < tmp/$SCRIPT | cut -b -8 | tr -d \\n).tgz 77 rm -f $ARCHIVE 78 echo \ \ Generating final archive 79 (cd tmp ; tar --owner=root --group=root -z -c -f ../$ARCHIVE $SCRIPT || echo \ \ \ \ Error archiving script) 80 rm -rf tmp 81done 82