blob: 31c374221ff9088b25357d00b70c3d00d2e5a6f0 [file] [log] [blame]
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -07001#!/bin/sh
2
Jean-Baptiste Queruf93f6db2013-05-20 15:21:04 -07003# Copyright 2010 The Android Open Source Project
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -07004#
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
Jean-Baptiste Queru36565c02012-06-23 09:39:26 -070017# start jb-dev
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -070018# 368864 = JRN61B
Jean-Baptiste Querufb3abab2012-06-04 09:03:54 -070019# 371028 = JRN65
Jean-Baptiste Queru696c5e62012-06-14 08:13:31 -070020# 382301 = JRN75
Jean-Baptiste Queru7e82c952012-06-19 08:03:45 -070021# 386704 = JRN80
Jean-Baptiste Queru36565c02012-06-23 09:39:26 -070022# 391496 = JRN83D
Jean-Baptiste Querud20e4522012-07-04 10:34:37 -070023# 397816 = JRO03B
Jean-Baptiste Querua37b22f2012-07-04 17:10:39 -070024# 398337 = JRO03C
Jean-Baptiste Querudb72e392012-08-01 14:51:37 -070025# 405518 = JRO03H
Jean-Baptiste Queru042f71f2012-09-21 13:48:27 -070026# 438695 = JRO03R
Jean-Baptiste Queru7b1de312012-09-17 08:30:17 -070027# 463694 = JZO54G
Jean-Baptiste Queru734bf8a2012-10-02 15:40:15 -070028# 485486 = JZO54K
Jean-Baptiste Queru36565c02012-06-23 09:39:26 -070029# end jb-dev
Jean-Baptiste Queru35809102012-11-02 13:31:12 -070030# start jb-mr1-dev
31# 521994 = JOP32B
Jean-Baptiste Queru6232c642012-11-06 09:26:07 -080032# 524024 = JOP36
Jean-Baptiste Querua78ca9b2012-11-09 13:27:24 -080033# 527221 = JOP40
Jean-Baptiste Queru7b797c32012-11-12 08:34:37 -080034# 527662 = JOP40C
Jean-Baptiste Querue8d35a72013-01-29 17:15:34 -080035# 561924 = JOP40G
Jean-Baptiste Queru35809102012-11-02 13:31:12 -070036# end jb-mr1-dev
Jean-Baptiste Queru829187c2012-12-27 08:43:02 -080037# start jb-mr1.1-dev
38# 551245 = JDP82
Jean-Baptiste Queruad051052013-02-14 14:11:18 -080039# 573038 = JDQ39
Jean-Baptiste Queru829187c2012-12-27 08:43:02 -080040# end jb-mr1.1-dev
Jean-Baptiste Queru44d1b342013-04-12 12:45:25 -070041# start jb-mr2-dev
42# 638589 = JWR11D
Jean-Baptiste Queruf93f6db2013-05-20 15:21:04 -070043# 681336 = JWR50
Jean-Baptiste Queru6e905c52013-05-21 11:09:05 -070044# 683083 = JWR51
Jean-Baptiste Querub98892b2013-05-22 17:42:30 -070045# 684634 = JWR52
Jean-Baptiste Querud80c6542013-05-23 09:16:10 -070046# 686185 = JWR53
Jean-Baptiste Queru3dbe55f2013-05-28 09:20:51 -070047# 689345 = JWR58
Jean-Baptiste Queru79dfd1e2013-05-29 08:53:21 -070048# 690834 = JWR59
Jean-Baptiste Queru65281682013-05-30 09:42:38 -070049# 692263 = JWR60
Jean-Baptiste Querufa65fc22013-06-03 08:04:32 -070050# 695489 = JWR64
Jean-Baptiste Queru2fcf0bb2013-06-06 12:06:48 -070051# 699533 = JWR66
Jean-Baptiste Queru808b9a22013-06-07 09:36:16 -070052# 701448 = JWR66C
Jean-Baptiste Queru7c3fc542013-06-11 08:32:50 -070053# 704243 = JWR66G
Jean-Baptiste Queru1f2970c2013-06-16 10:16:02 -070054# 711294 = JWR66N
Jean-Baptiste Queru6a21b862013-07-10 15:34:33 -070055# 736095 = JWR66U
Jean-Baptiste Queru555e4db2013-07-11 15:10:50 -070056# 737497 = JWR66V
Jean-Baptiste Queru44d1b342013-04-12 12:45:25 -070057# end jb-mr2-dev
Conley Owens87828532013-12-10 16:33:19 -080058BRANCH=klp-dev
Jean-Baptiste Querue8d35a72013-01-29 17:15:34 -080059if test $BRANCH = jb-dev
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -070060then
Jean-Baptiste Queru734bf8a2012-10-02 15:40:15 -070061 ZIP=nakasi-ota-485486.zip
62 BUILD=jzo54k
Jean-Baptiste Queru36565c02012-06-23 09:39:26 -070063fi # jb-dev
Jean-Baptiste Querue8d35a72013-01-29 17:15:34 -080064if test $BRANCH = jb-mr1-dev
Jean-Baptiste Queru35809102012-11-02 13:31:12 -070065then
Jean-Baptiste Querue8d35a72013-01-29 17:15:34 -080066 ZIP=nakasi-ota-561924.zip
67 BUILD=jop40g
Jean-Baptiste Queru35809102012-11-02 13:31:12 -070068fi # jb-mr1-dev
Jean-Baptiste Querue8d35a72013-01-29 17:15:34 -080069if test $BRANCH = jb-mr1.1-dev
Jean-Baptiste Queru829187c2012-12-27 08:43:02 -080070then
Jean-Baptiste Queruad051052013-02-14 14:11:18 -080071 ZIP=nakasi-ota-573038.zip
72 BUILD=jdq39
Jean-Baptiste Queru829187c2012-12-27 08:43:02 -080073fi # jb-mr1.1-dev
Jean-Baptiste Queru44d1b342013-04-12 12:45:25 -070074if test $BRANCH = jb-mr2-dev
75then
Jean-Baptiste Queru555e4db2013-07-11 15:10:50 -070076 ZIP=nakasi-ota-737497
77 BUILD=jwr66v
Jean-Baptiste Queru44d1b342013-04-12 12:45:25 -070078fi # jb-mr2-dev
Conley Owens87828532013-12-10 16:33:19 -080079if test $BRANCH = klp-dev
80then
81 ZIP=nakasi-ota-937116
82 BUILD=kot49h
83fi # klp-dev
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -070084ROOTDEVICE=grouper
85DEVICE=grouper
86MANUFACTURER=asus
87
Jean-Baptiste Queruad051052013-02-14 14:11:18 -080088for COMPANY in asus broadcom elan invensense nvidia nxp widevine
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -070089do
90 echo Processing files from $COMPANY
91 rm -rf tmp
92 FILEDIR=tmp/vendor/$COMPANY/$DEVICE/proprietary
93 mkdir -p $FILEDIR
94 mkdir -p tmp/vendor/$MANUFACTURER/$ROOTDEVICE
95 case $COMPANY in
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -070096 asus)
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -070097 TO_EXTRACT="\
Jean-Baptiste Queru7b1de312012-09-17 08:30:17 -070098 system/bin/sensors-config \
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -070099 system/lib/hw/camera.tegra3.so \
Jean-Baptiste Queru7b1de312012-09-17 08:30:17 -0700100 system/lib/hw/sensors.grouper.so \
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -0700101 system/lib/libsensors.lightsensor.so \
Jean-Baptiste Queru7e82c952012-06-19 08:03:45 -0700102 system/vendor/lib/drm/libdrmwvmplugin.so \
103 system/vendor/lib/libwvm.so \
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -0700104 "
105 ;;
Jean-Baptiste Querub4a60002012-07-04 09:26:18 -0700106 broadcom)
107 TO_EXTRACT="\
Jean-Baptiste Queru7b1de312012-09-17 08:30:17 -0700108 system/bin/glgps \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700109 system/etc/firmware/bcm4330.hcd \
Jean-Baptiste Queru7b1de312012-09-17 08:30:17 -0700110 system/etc/gps/gpsconfig.xml \
111 system/lib/hw/gps.tegra3.so \
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -0700112 "
113 ;;
114 elan)
115 TO_EXTRACT="\
116 system/etc/firmware/touch_fw.ekt \
117 "
118 ;;
119 invensense)
120 TO_EXTRACT="\
121 system/lib/libinvensense_hal.so \
122 system/lib/libmllite.so \
123 system/lib/libmplmpu.so \
124 "
125 ;;
126 nvidia)
127 TO_EXTRACT="\
Jean-Baptiste Queruad051052013-02-14 14:11:18 -0800128 system/bin/tf_daemon \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700129 system/etc/firmware/nvavp_os_00001000.bin \
130 system/etc/firmware/nvavp_os_0ff00000.bin \
131 system/etc/firmware/nvavp_os_e0000000.bin \
132 system/etc/firmware/nvavp_os_eff00000.bin \
133 system/etc/firmware/nvavp_vid_ucode_alt.bin \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700134 system/etc/nvcamera.conf \
135 system/etc/nvram.txt \
136 system/lib/egl/libEGL_tegra.so \
137 system/lib/egl/libGLESv1_CM_tegra.so \
138 system/lib/egl/libGLESv2_tegra.so \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700139 system/lib/hw/gralloc.tegra3.so \
140 system/lib/hw/hwcomposer.tegra3.so \
Jean-Baptiste Queru7e82c952012-06-19 08:03:45 -0700141 system/lib/libardrv_dynamic.so \
142 system/lib/libcgdrv.so \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700143 system/lib/libnvapputil.so \
144 system/lib/libnvasfparserhal.so \
145 system/lib/libnvaviparserhal.so \
146 system/lib/libnvavp.so \
147 system/lib/libnvcamerahdr.so \
148 system/lib/libnvddk_2d.so \
149 system/lib/libnvddk_2d_v2.so \
150 system/lib/libnvdispmgr_d.so \
151 system/lib/libnvmm.so \
152 system/lib/libnvmmlite.so \
153 system/lib/libnvmmlite_audio.so \
154 system/lib/libnvmmlite_image.so \
155 system/lib/libnvmmlite_utils.so \
156 system/lib/libnvmmlite_video.so \
157 system/lib/libnvmm_audio.so \
158 system/lib/libnvmm_camera.so \
159 system/lib/libnvmm_contentpipe.so \
160 system/lib/libnvmm_image.so \
161 system/lib/libnvmm_manager.so \
162 system/lib/libnvmm_misc.so \
163 system/lib/libnvmm_parser.so \
164 system/lib/libnvmm_service.so \
165 system/lib/libnvmm_utils.so \
166 system/lib/libnvmm_video.so \
167 system/lib/libnvmm_writer.so \
168 system/lib/libnvodm_dtvtuner.so \
169 system/lib/libnvodm_hdmi.so \
170 system/lib/libnvodm_imager.so \
171 system/lib/libnvodm_misc.so \
172 system/lib/libnvodm_query.so \
173 system/lib/libnvomx.so \
174 system/lib/libnvomxilclient.so \
175 system/lib/libnvos.so \
176 system/lib/libnvparser.so \
177 system/lib/libnvrm.so \
178 system/lib/libnvrm_graphics.so \
179 system/lib/libnvsm.so \
180 system/lib/libnvtvmr.so \
181 system/lib/libnvwinsys.so \
182 system/lib/libnvwsi.so \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700183 system/lib/libstagefrighthw.so \
184 system/lib/libtf_crypto_sst.so \
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -0700185 "
186 ;;
187 nxp)
188 TO_EXTRACT="\
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700189 system/vendor/firmware/libpn544_fw.so \
Jean-Baptiste Queru669b7422012-06-05 08:12:15 -0700190 "
191 ;;
192 widevine)
193 TO_EXTRACT="\
Jean-Baptiste Queru7e82c952012-06-19 08:03:45 -0700194 system/lib/libdrmdecrypt.so \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700195 system/vendor/lib/libwvdrm_L1.so \
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700196 system/vendor/lib/libWVStreamControlAPI_L1.so
197 "
198 ;;
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700199 esac
200 echo \ \ Extracting files from OTA package
201 for ONE_FILE in $TO_EXTRACT
202 do
203 echo \ \ \ \ Extracting $ONE_FILE
204 unzip -j -o $ZIP $ONE_FILE -d $FILEDIR > /dev/null || echo \ \ \ \ Error extracting $ONE_FILE
205 if test $ONE_FILE = system/vendor/bin/gpsd -o $ONE_FILE = system/vendor/bin/pvrsrvinit -o $ONE_FILE = system/bin/fRom
206 then
207 chmod a+x $FILEDIR/$(basename $ONE_FILE) || echo \ \ \ \ Error chmoding $ONE_FILE
208 fi
Jean-Baptiste Querub1ae9e52012-06-01 08:40:39 -0700209 done
210 echo \ \ Setting up $COMPANY-specific makefiles
211 cp -R $COMPANY/staging/* tmp/vendor/$COMPANY/$DEVICE || echo \ \ \ \ Error copying makefiles
212 echo \ \ Setting up shared makefiles
213 cp -R root/* tmp/vendor/$MANUFACTURER/$ROOTDEVICE || echo \ \ \ \ Error copying makefiles
214 echo \ \ Generating self-extracting script
215 SCRIPT=extract-$COMPANY-$DEVICE.sh
216 cat PROLOGUE > tmp/$SCRIPT || echo \ \ \ \ Error generating script
217 cat $COMPANY/COPYRIGHT >> tmp/$SCRIPT || echo \ \ \ \ Error generating script
218 cat PART1 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script
219 cat $COMPANY/LICENSE >> tmp/$SCRIPT || echo \ \ \ \ Error generating script
220 cat PART2 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script
221 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
222 cat PART3 >> tmp/$SCRIPT || echo \ \ \ \ Error generating script
223 (cd tmp ; tar zc --owner=root --group=root vendor/ >> $SCRIPT || echo \ \ \ \ Error generating embedded tgz)
224 chmod a+x tmp/$SCRIPT || echo \ \ \ \ Error generating script
225 ARCHIVE=$COMPANY-$DEVICE-$BUILD-$(md5sum < tmp/$SCRIPT | cut -b -8 | tr -d \\n).tgz
226 rm -f $ARCHIVE
227 echo \ \ Generating final archive
228 (cd tmp ; tar --owner=root --group=root -z -c -f ../$ARCHIVE $SCRIPT || echo \ \ \ \ Error archiving script)
229 rm -rf tmp
230done