1#!/bin/sh 2 3# Copyright 2012 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 klp-dev 18# 886418 = KRT16I 19# end klp-dev 20BRANCH=klp-dev 21if test $BRANCH = klp-dev 22then 23 ZIP=hammerhead-ota-937116 24 BUILD=kot49h 25fi # klp-dev 26ROOTDEVICE=hammerhead 27DEVICE=hammerhead 28MANUFACTURER=lge 29 30for COMPANY in broadcom lge qcom 31do 32 echo Processing files from $COMPANY 33 rm -rf tmp 34 FILEDIR=tmp/vendor/$COMPANY/$DEVICE/proprietary 35 mkdir -p $FILEDIR 36 mkdir -p tmp/vendor/$MANUFACTURER/$ROOTDEVICE 37 case $COMPANY in 38 broadcom) 39 TO_EXTRACT="\ 40 system/vendor/firmware/bcm2079x-b5_firmware.ncd \ 41 system/vendor/firmware/bcm2079x-b5_pre_firmware.ncd \ 42 system/vendor/firmware/bcm4335c0.hcd \ 43 " 44 ;; 45 lge) 46 TO_EXTRACT="\ 47 system/app/qcrilmsgtunnel/qcrilmsgtunnel.apk \ 48 system/app/UpdateSetting.apk \ 49 system/etc/acdbdata/MTP/MTP_Bluetooth_cal.acdb \ 50 system/etc/acdbdata/MTP/MTP_General_cal.acdb \ 51 system/etc/acdbdata/MTP/MTP_Global_cal.acdb \ 52 system/etc/acdbdata/MTP/MTP_Handset_cal.acdb \ 53 system/etc/acdbdata/MTP/MTP_Hdmi_cal.acdb \ 54 system/etc/acdbdata/MTP/MTP_Headset_cal.acdb \ 55 system/etc/permissions/serviceitems.xml \ 56 system/etc/qcril.db \ 57 system/etc/sensor_def_hh.conf \ 58 system/etc/acdbdata/MTP/MTP_Speaker_cal.acdb \ 59 system/framework/serviceitems.jar \ 60 system/vendor/bin/vss_init \ 61 system/vendor/firmware/bu24205_LGIT_VER_2_DATA1.bin \ 62 system/vendor/firmware/bu24205_LGIT_VER_2_DATA2.bin \ 63 system/vendor/firmware/bu24205_LGIT_VER_2_DATA3.bin \ 64 system/vendor/firmware/bu24205_LGIT_VER_3_CAL.bin \ 65 system/vendor/firmware/bu24205_LGIT_VER_3_DATA1.bin \ 66 system/vendor/firmware/bu24205_LGIT_VER_3_DATA2.bin \ 67 system/vendor/firmware/bu24205_LGIT_VER_3_DATA3.bin \ 68 system/vendor/firmware/keymaster/keymaster.b00 \ 69 system/vendor/firmware/keymaster/keymaster.b01 \ 70 system/vendor/firmware/keymaster/keymaster.b02 \ 71 system/vendor/firmware/keymaster/keymaster.b03 \ 72 system/vendor/firmware/keymaster/keymaster.mdt \ 73 system/vendor/lib/libAKM8963.so \ 74 system/vendor/lib/libvss_common_core.so \ 75 system/vendor/lib/libvss_common_idl.so \ 76 system/vendor/lib/libvss_common_iface.so \ 77 system/vendor/lib/libvss_nv_core.so \ 78 system/vendor/lib/libvss_nv_idl.so \ 79 system/vendor/lib/libvss_nv_iface.so \ 80 " 81 ;; 82 qcom) 83 TO_EXTRACT="\ 84 system/bin/bridgemgrd \ 85 system/bin/diag_klog \ 86 system/bin/diag_mdlog \ 87 system/bin/ds_fmc_appd \ 88 system/bin/irsc_util \ 89 system/bin/mm-qcamera-daemon \ 90 system/bin/mpdecision \ 91 system/bin/netmgrd \ 92 system/bin/nl_listener \ 93 system/bin/port-bridge \ 94 system/bin/qmuxd \ 95 system/bin/qseecomd \ 96 system/bin/radish \ 97 system/bin/rmt_storage \ 98 system/bin/sensors.qcom \ 99 system/bin/subsystem_ramdump \ 100 system/bin/thermal-engine-hh \ 101 system/bin/time_daemon \ 102 system/bin/usbhub \ 103 system/bin/usbhub_init \ 104 system/etc/firmware/cpp_firmware_v1_1_1.fw \ 105 system/etc/firmware/cpp_firmware_v1_1_6.fw \ 106 system/etc/firmware/cpp_firmware_v1_2_0.fw \ 107 system/etc/permissions/qcrilhook.xml \ 108 system/framework/qcrilhook.jar \ 109 system/lib/hw/flp.msm8974.so \ 110 system/lib/hw/gps.msm8974.so \ 111 system/lib/libadsprpc.so \ 112 system/lib/libchromatix_imx179_common.so \ 113 system/lib/libchromatix_imx179_default_video.so \ 114 system/lib/libchromatix_imx179_preview.so \ 115 system/lib/libchromatix_imx179_snapshot.so \ 116 system/lib/libchromatix_mt9m114b_common.so \ 117 system/lib/libchromatix_mt9m114b_default_video.so \ 118 system/lib/libchromatix_mt9m114b_preview.so \ 119 system/lib/libchromatix_mt9m114b_snapshot.so \ 120 system/lib/libdrmdiag.so \ 121 system/lib/libdrmfs.so \ 122 system/lib/libdrmtime.so \ 123 system/lib/libgps.utils.so \ 124 system/lib/libI420colorconvert.so \ 125 system/lib/libloc_core.so \ 126 system/lib/libloc_eng.so \ 127 system/lib/libmm-abl.so \ 128 system/lib/libmmcamera_hdr_lib.so \ 129 system/lib/libmmcamera_image_stab.so \ 130 system/lib/libmmcamera_imx179.so \ 131 system/lib/libmmcamera_mt9m114b.so \ 132 system/lib/libmmcamera_wavelet_lib.so \ 133 system/lib/libmm-color-convertor.so \ 134 system/lib/libmmQSM.so \ 135 system/lib/liboemcrypto.so \ 136 system/lib/libQSEEComAPI.so \ 137 system/lib/libril-qc-qmi-1.so \ 138 system/lib/libstagefright_hdcp.so \ 139 system/lib/libxml.so \ 140 system/vendor/firmware/a330_pfp.fw \ 141 system/vendor/firmware/a330_pm4.fw \ 142 system/vendor/firmware/adsp.b00 \ 143 system/vendor/firmware/adsp.b01 \ 144 system/vendor/firmware/adsp.b02 \ 145 system/vendor/firmware/adsp.b03 \ 146 system/vendor/firmware/adsp.b04 \ 147 system/vendor/firmware/adsp.b05 \ 148 system/vendor/firmware/adsp.b06 \ 149 system/vendor/firmware/adsp.b07 \ 150 system/vendor/firmware/adsp.b08 \ 151 system/vendor/firmware/adsp.b09 \ 152 system/vendor/firmware/adsp.b10 \ 153 system/vendor/firmware/adsp.b11 \ 154 system/vendor/firmware/adsp.b12 \ 155 system/vendor/firmware/adsp.mdt \ 156 system/vendor/firmware/cmnlib.b00 \ 157 system/vendor/firmware/cmnlib.b01 \ 158 system/vendor/firmware/cmnlib.b02 \ 159 system/vendor/firmware/cmnlib.b03 \ 160 system/vendor/firmware/cmnlib.mdt \ 161 system/vendor/firmware/venus.b00 \ 162 system/vendor/firmware/venus.b01 \ 163 system/vendor/firmware/venus.b02 \ 164 system/vendor/firmware/venus.b03 \ 165 system/vendor/firmware/venus.b04 \ 166 system/vendor/firmware/venus.mdt \ 167 system/vendor/lib/egl/eglsubAndroid.so \ 168 system/vendor/lib/egl/libEGL_adreno.so \ 169 system/vendor/lib/egl/libGLESv1_CM_adreno.so \ 170 system/vendor/lib/egl/libGLESv2_adreno.so \ 171 system/vendor/lib/egl/libplayback_adreno.so \ 172 system/vendor/lib/egl/libq3dtools_adreno.so \ 173 system/vendor/lib/hw/sensors.msm8974.so \ 174 system/vendor/lib/libacdbloader.so \ 175 system/vendor/lib/libacdbrtac.so \ 176 system/vendor/lib/libadiertac.so \ 177 system/vendor/lib/libadreno_utils.so \ 178 system/vendor/lib/libaudcal.so \ 179 system/vendor/lib/libC2D2.so \ 180 system/vendor/lib/libc2d30-a3xx.so \ 181 system/vendor/lib/libc2d30.so \ 182 system/vendor/lib/libCB.so \ 183 system/vendor/lib/libCommandSvc.so \ 184 system/vendor/lib/libconfigdb.so \ 185 system/vendor/lib/libdiag.so \ 186 system/vendor/lib/libdrmdecrypt.so \ 187 system/vendor/lib/libdsi_netctrl.so \ 188 system/vendor/lib/libdsutils.so \ 189 system/vendor/lib/libFuzzmmstillomxenc.so \ 190 system/vendor/lib/libgeofence.so \ 191 system/vendor/lib/libgsl.so \ 192 system/vendor/lib/libidl.so \ 193 system/vendor/lib/libizat_core.so \ 194 system/vendor/lib/libjpegdhw.so \ 195 system/vendor/lib/libjpegehw.so \ 196 system/vendor/lib/libllvm-qcom.so \ 197 system/vendor/lib/libbccQTI.so \ 198 system/vendor/lib/libloc_api_v02.so \ 199 system/vendor/lib/libloc_ds_api.so \ 200 system/vendor/lib/libmmcamera2_c2d_module.so \ 201 system/vendor/lib/libmmcamera2_cpp_module.so \ 202 system/vendor/lib/libmmcamera2_iface_modules.so \ 203 system/vendor/lib/libmmcamera2_imglib_modules.so \ 204 system/vendor/lib/libmmcamera2_isp_modules.so \ 205 system/vendor/lib/libmmcamera2_pproc_modules.so \ 206 system/vendor/lib/libmmcamera2_sensor_modules.so \ 207 system/vendor/lib/libmmcamera2_stats_algorithm.so \ 208 system/vendor/lib/libmmcamera2_stats_modules.so \ 209 system/vendor/lib/libmmcamera2_vpe_module.so \ 210 system/vendor/lib/libmmcamera2_wnr_module.so \ 211 system/vendor/lib/libmmcamera_faceproc.so \ 212 system/vendor/lib/libmmcamera_imglib.so \ 213 system/vendor/lib/libmmcamera_imx179_eeprom.so \ 214 system/vendor/lib/libmmipl.so \ 215 system/vendor/lib/libmmjpeg.so \ 216 system/vendor/lib/libmmqjpeg_codec.so \ 217 system/vendor/lib/libnetmgr.so \ 218 system/vendor/lib/liboemcamera.so \ 219 system/vendor/lib/libqcci_legacy.so \ 220 system/vendor/lib/libqdi.so \ 221 system/vendor/lib/libqdp.so \ 222 system/vendor/lib/libqmi_cci.so \ 223 system/vendor/lib/libqmi_client_qmux.so \ 224 system/vendor/lib/libqmi_common_so.so \ 225 system/vendor/lib/libqmi_csi.so \ 226 system/vendor/lib/libqmi_encdec.so \ 227 system/vendor/lib/libqmiservices.so \ 228 system/vendor/lib/libqmi.so \ 229 system/vendor/lib/libqomx_jpegenc.so \ 230 system/vendor/lib/libril-qcril-hook-oem.so \ 231 system/vendor/lib/librs_adreno_sha1.so \ 232 system/vendor/lib/librs_adreno.so \ 233 system/vendor/lib/libRSDriver_adreno.so \ 234 system/vendor/lib/libsc-a3xx.so \ 235 system/vendor/lib/libsensor1.so \ 236 system/vendor/lib/libsensor_reg.so \ 237 system/vendor/lib/libsensor_user_cal.so \ 238 system/vendor/lib/libtime_genoff.so \ 239 system/vendor/lib/libTimeService.so \ 240 " 241 ;; 242 esac 243 echo \ \ Extracting files from OTA package 244 for ONE_FILE in $TO_EXTRACT 245 do 246 echo \ \ \ \ Extracting $ONE_FILE 247 unzip -j -o $ZIP $ONE_FILE -d $FILEDIR > /dev/null || echo \ \ \ \ Error extracting $ONE_FILE 248 if test $ONE_FILE = system/vendor/bin/gpsd -o $ONE_FILE = system/vendor/bin/pvrsrvinit -o $ONE_FILE = system/bin/fRom 249 then 250 chmod a+x $FILEDIR/$(basename $ONE_FILE) || echo \ \ \ \ Error chmoding $ONE_FILE 251 fi 252 done 253 echo \ \ Setting up $COMPANY-specific makefiles 254 cp -R $COMPANY/staging/* tmp/vendor/$COMPANY/$DEVICE || echo \ \ \ \ Error copying makefiles 255 echo \ \ Setting up shared makefiles 256 cp -R root/* tmp/vendor/$MANUFACTURER/$ROOTDEVICE || echo \ \ \ \ Error copying makefiles 257 echo \ \ Generating self-extracting script 258 SCRIPT=extract-$COMPANY-$DEVICE.sh 259 cat PROLOGUE > tmp/$SCRIPT || echo \ \ \ \ Error generating script 260 cat $COMPANY/COPYRIGHT >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 261 cat PART1 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 262 cat $COMPANY/LICENSE >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 263 cat PART2 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 264 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 265 cat PART3 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script 266 (cd tmp ; tar zc --owner=root --group=root vendor/ >> $SCRIPT || echo \ \ \ \ Error generating embedded tgz) 267 chmod a+x tmp/$SCRIPT || echo \ \ \ \ Error generating script 268 ARCHIVE=$COMPANY-$DEVICE-$BUILD-$(md5sum < tmp/$SCRIPT | cut -b -8 | tr -d \\n).tgz 269 rm -f $ARCHIVE 270 echo \ \ Generating final archive 271 (cd tmp ; tar --owner=root --group=root -z -c -f ../$ARCHIVE $SCRIPT || echo \ \ \ \ Error archiving script) 272 rm -rf tmp 273done 274