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# start jb-mr2-dev 18# 700272 = JSR67 19# 703372 = JSR71 20# 704765 = JSR72 21# 708191 = JSR74 22# 711747 = JSR78 23# 713896 = JSR78B 24# 719009 = JSR82 25# 725949 = JSR88 26# 728843 = JSS01 27# 730471 = JSS02B 28# 740015 = JSS11F 29# 741000 = JSS11I 30# 741250 = JSS15 31# 746990 = JSS15H 32# 748502 = JSS15I 33# 748593 = JSS15J 34# 750418 = JSS15K 35# end jb-mr2-dev 36BRANCH=klp-dev 37if test $BRANCH = klp-dev 38then 39 ZIP=razorg-ota-937116 40 BUILD=kot49h 41fi # klp-dev 42ROOTDEVICE=deb 43DEVICE=deb 44MANUFACTURER=asus 45 46for COMPANY in asus broadcom qcom 47do 48 echo Processing files from $COMPANY 49 rm -rf tmp 50 FILEDIR=tmp/vendor/$COMPANY/$DEVICE/proprietary 51 mkdir -p $FILEDIR 52 mkdir -p tmp/vendor/$MANUFACTURER/$ROOTDEVICE 53 case $COMPANY in 54 asus) 55 TO_EXTRACT="\ 56 system/etc/apns-conf.xml \ 57 system/lib/libacdbdata.so \ 58 system/lib/libAKM.so \ 59 " 60 ;; 61 broadcom) 62 TO_EXTRACT="\ 63 system/vendor/firmware/bcm2079x-b5_firmware.ncd \ 64 system/vendor/firmware/bcm2079x-b5_pre_firmware.ncd \ 65 " 66 ;; 67 qcom) 68 TO_EXTRACT="\ 69 system/bin/ATFWD-daemon \ 70 system/bin/bridgemgrd \ 71 system/bin/btnvtool \ 72 system/bin/diag_klog \ 73 system/bin/diag_mdlog \ 74 system/bin/ds_fmc_appd \ 75 system/bin/efsks \ 76 system/bin/hci_qcomm_init \ 77 system/bin/irsc_util \ 78 system/bin/ks \ 79 system/bin/mm-qcamera-app \ 80 system/bin/mm-qcamera-daemon \ 81 system/bin/mm-qjpeg-enc-test \ 82 system/bin/mm-qomx-ienc-test \ 83 system/bin/mpdecision \ 84 system/bin/netmgrd \ 85 system/bin/nl_listener \ 86 system/bin/port-bridge \ 87 system/bin/qcks \ 88 system/bin/qmuxd \ 89 system/bin/qseecomd \ 90 system/bin/radish \ 91 system/bin/rmt_storage \ 92 system/bin/sensors.qcom \ 93 system/bin/thermald \ 94 system/bin/usbhub \ 95 system/bin/usbhub_init \ 96 system/etc/firmware/vidc_1080p.fw \ 97 system/etc/firmware/vidc.b00 \ 98 system/etc/firmware/vidc.b01 \ 99 system/etc/firmware/vidc.b02 \ 100 system/etc/firmware/vidc.b03 \ 101 system/etc/firmware/vidcfw.elf \ 102 system/etc/firmware/vidc.mdt \ 103 system/etc/gps.conf \ 104 system/vendor/lib/egl/eglsubAndroid.so \ 105 system/vendor/lib/egl/libEGL_adreno.so \ 106 system/vendor/lib/egl/libGLESv1_CM_adreno.so \ 107 system/vendor/lib/egl/libGLESv2_adreno.so \ 108 system/vendor/lib/egl/libplayback_adreno.so \ 109 system/vendor/lib/egl/libq3dtools_adreno.so \ 110 system/lib/hw/flp.msm8960.so \ 111 system/lib/hw/gps.msm8960.so \ 112 system/lib/hw/sensors.msm8960.so \ 113 system/lib/libacdbloader.so \ 114 system/vendor/lib/libadreno_utils.so \ 115 system/lib/libaudcal.so \ 116 system/lib/libaudioalsa.so \ 117 system/vendor/lib/libC2D2.so \ 118 system/vendor/lib/libc2d30-a3xx.so \ 119 system/vendor/lib/libc2d30.so \ 120 system/vendor/lib/libCB.so \ 121 system/lib/libchromatix_ov5693_common.so \ 122 system/lib/libchromatix_ov5693_default_video.so \ 123 system/lib/libchromatix_ov5693_preview.so \ 124 system/lib/libCommandSvc.so \ 125 system/lib/libconfigdb.so \ 126 system/lib/libcsd-client.so \ 127 system/lib/libdiag.so \ 128 system/lib/libdrmdiag.so \ 129 system/lib/libdrmfs.so \ 130 system/lib/libdrmtime.so \ 131 system/lib/libdsi_netctrl.so \ 132 system/lib/libdsprofile.so \ 133 system/lib/libdss.so \ 134 system/lib/libdsucsd.so \ 135 system/lib/libdsutils.so \ 136 system/lib/libDxHdcp.so \ 137 system/lib/libgps.utils.so \ 138 system/vendor/lib/libgsl.so \ 139 system/lib/libI420colorconvert.so \ 140 system/lib/libidl.so \ 141 system/vendor/lib/libllvm-qcom.so \ 142 system/lib/libloc_core.so \ 143 system/lib/libloc_eng.so \ 144 system/lib/libmm-abl.so \ 145 system/lib/libmmcamera2_stats_algorithm.so \ 146 system/lib/libmmcamera_image_stab.so \ 147 system/lib/libmmcamera_mi1040.so \ 148 system/lib/libmmcamera_ov5693.so \ 149 system/lib/libmm-color-convertor.so \ 150 system/lib/libnetmgr.so \ 151 system/lib/liboemcrypto.so \ 152 system/lib/libqcci_legacy.so \ 153 system/lib/libqdi.so \ 154 system/lib/libqdp.so \ 155 system/lib/libqmi_cci.so \ 156 system/lib/libqmi_client_qmux.so \ 157 system/lib/libqmi_common_so.so \ 158 system/lib/libqmi_csi.so \ 159 system/lib/libqmi_csvt_srvc.so \ 160 system/lib/libqmi_encdec.so \ 161 system/lib/libqmiservices.so \ 162 system/lib/libqmi.so \ 163 system/lib/libQSEEComAPI.so \ 164 system/lib/libril-qc-qmi-1.so \ 165 system/lib/libril-qcril-hook-oem.so \ 166 system/vendor/lib/librs_adreno_sha1.so \ 167 system/vendor/lib/librs_adreno.so \ 168 system/vendor/lib/libRSDriver_adreno.so \ 169 system/vendor/lib/libsc-a3xx.so \ 170 system/lib/libsensor1.so \ 171 system/lib/libsensor_reg.so \ 172 system/lib/libsensor_user_cal.so \ 173 system/lib/libstagefright_hdcp.so \ 174 system/lib/libxml.so \ 175 system/vendor/firmware/a300_pfp.fw \ 176 system/vendor/firmware/a300_pm4.fw \ 177 system/vendor/firmware/discretix/dxhdcp2.b00 \ 178 system/vendor/firmware/discretix/dxhdcp2.b01 \ 179 system/vendor/firmware/discretix/dxhdcp2.b02 \ 180 system/vendor/firmware/discretix/dxhdcp2.b03 \ 181 system/vendor/firmware/discretix/dxhdcp2.mdt \ 182 system/vendor/firmware/dsps.b00 \ 183 system/vendor/firmware/dsps.b01 \ 184 system/vendor/firmware/dsps.b02 \ 185 system/vendor/firmware/dsps.b03 \ 186 system/vendor/firmware/dsps.b04 \ 187 system/vendor/firmware/dsps.b05 \ 188 system/vendor/firmware/dsps.mdt \ 189 system/vendor/firmware/gss.b00 \ 190 system/vendor/firmware/gss.b01 \ 191 system/vendor/firmware/gss.b02 \ 192 system/vendor/firmware/gss.b03 \ 193 system/vendor/firmware/gss.b04 \ 194 system/vendor/firmware/gss.b05 \ 195 system/vendor/firmware/gss.b06 \ 196 system/vendor/firmware/gss.b07 \ 197 system/vendor/firmware/gss.b08 \ 198 system/vendor/firmware/gss.b09 \ 199 system/vendor/firmware/gss.b10 \ 200 system/vendor/firmware/gss.b11 \ 201 system/vendor/firmware/gss.mdt \ 202 system/vendor/firmware/keymaster/keymaster.b00 \ 203 system/vendor/firmware/keymaster/keymaster.b01 \ 204 system/vendor/firmware/keymaster/keymaster.b02 \ 205 system/vendor/firmware/keymaster/keymaster.b03 \ 206 system/vendor/firmware/keymaster/keymaster.mdt \ 207 system/vendor/firmware/q6.b00 \ 208 system/vendor/firmware/q6.b01 \ 209 system/vendor/firmware/q6.b03 \ 210 system/vendor/firmware/q6.b04 \ 211 system/vendor/firmware/q6.b05 \ 212 system/vendor/firmware/q6.b06 \ 213 system/vendor/firmware/q6.mdt \ 214 system/vendor/firmware/tzapps.b00 \ 215 system/vendor/firmware/tzapps.b01 \ 216 system/vendor/firmware/tzapps.b02 \ 217 system/vendor/firmware/tzapps.b03 \ 218 system/vendor/firmware/tzapps.mdt \ 219 system/vendor/firmware/wcnss.b00 \ 220 system/vendor/firmware/wcnss.b01 \ 221 system/vendor/firmware/wcnss.b02 \ 222 system/vendor/firmware/wcnss.b04 \ 223 system/vendor/firmware/wcnss.b05 \ 224 system/vendor/firmware/wcnss.mdt \ 225 system/vendor/lib/libdrmdecrypt.so \ 226 system/vendor/lib/libgemini.so \ 227 system/vendor/lib/libgeofence.so \ 228 system/vendor/lib/libimage-jpeg-enc-omx-comp.so \ 229 system/vendor/lib/libimage-omx-common.so \ 230 system/vendor/lib/libizat_core.so \ 231 system/vendor/lib/libloc_api_v02.so \ 232 system/vendor/lib/libloc_ds_api.so \ 233 system/vendor/lib/libmmcamera2_c2d_module.so \ 234 system/vendor/lib/libmmcamera2_cpp_module.so \ 235 system/vendor/lib/libmmcamera2_iface_modules.so \ 236 system/vendor/lib/libmmcamera2_imglib_modules.so \ 237 system/vendor/lib/libmmcamera2_isp_modules.so \ 238 system/vendor/lib/libmmcamera2_pproc_modules.so \ 239 system/vendor/lib/libmmcamera2_sensor_modules.so \ 240 system/vendor/lib/libmmcamera2_stats_modules.so \ 241 system/vendor/lib/libmmcamera2_vpe_module.so \ 242 system/vendor/lib/libmmcamera2_wnr_module.so \ 243 system/vendor/lib/libmmcamera_faceproc.so \ 244 system/vendor/lib/libmmcamera_imglib.so \ 245 system/vendor/lib/libmmipl.so \ 246 system/vendor/lib/libmmjpeg.so \ 247 system/vendor/lib/libmmqjpeg_codec.so \ 248 system/vendor/lib/libmmstillomx.so \ 249 system/vendor/lib/liboemcamera.so \ 250 system/vendor/lib/libqomx_jpegenc.so \ 251 " 252 ;; 253 esac 254 echo \ \ Extracting files from OTA package 255 for ONE_FILE in $TO_EXTRACT 256 do 257 echo \ \ \ \ Extracting $ONE_FILE 258 unzip -j -o $ZIP $ONE_FILE -d $FILEDIR > /dev/null || echo \ \ \ \ Error extracting $ONE_FILE 259 if test $ONE_FILE = system/vendor/bin/gpsd -o $ONE_FILE = system/vendor/bin/pvrsrvinit -o $ONE_FILE = system/bin/fRom 260 then 261 chmod a+x $FILEDIR/$(basename $ONE_FILE) || echo \ \ \ \ Error chmoding $ONE_FILE 262 fi 263 done 264 echo \ \ Setting up $COMPANY-specific makefiles 265 cp -R $COMPANY/staging/* tmp/vendor/$COMPANY/$DEVICE || echo \ \ \ \ Error copying makefiles 266 echo \ \ Setting up shared makefiles 267 cp -R root/* tmp/vendor/$MANUFACTURER/$ROOTDEVICE || echo \ \ \ \ Error copying makefiles 268 echo \ \ Generating self-extracting script 269 SCRIPT=extract-$COMPANY-$DEVICE.sh 270 cat PROLOGUE > tmp/$SCRIPT || echo \ \ \ \ Error generating script 271 cat $COMPANY/COPYRIGHT >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 272 cat PART1 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 273 cat $COMPANY/LICENSE >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 274 cat PART2 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 275 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 276 cat PART3 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 277 (cd tmp ; tar zc --owner=root --group=root vendor/ >> $SCRIPT || echo \ \ \ \ Error generating embedded tgz) 278 chmod a+x tmp/$SCRIPT || echo \ \ \ \ Error generating script 279 ARCHIVE=$COMPANY-$DEVICE-$BUILD-$(md5sum < tmp/$SCRIPT | cut -b -8 | tr -d \\n).tgz 280 rm -f $ARCHIVE 281 echo \ \ Generating final archive 282 (cd tmp ; tar --owner=root --group=root -z -c -f ../$ARCHIVE $SCRIPT || echo \ \ \ \ Error archiving script) 283 rm -rf tmp 284done 285