Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Jean-Baptiste Queru | f93f6db | 2013-05-20 15:21:04 -0700 | [diff] [blame] | 3 | # Copyright 2010 The Android Open Source Project |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 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 | |
Jean-Baptiste Queru | 36565c0 | 2012-06-23 09:39:26 -0700 | [diff] [blame] | 17 | # start jb-dev |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 18 | # 368864 = JRN61B |
Jean-Baptiste Queru | fb3abab | 2012-06-04 09:03:54 -0700 | [diff] [blame] | 19 | # 371028 = JRN65 |
Jean-Baptiste Queru | 696c5e6 | 2012-06-14 08:13:31 -0700 | [diff] [blame] | 20 | # 382301 = JRN75 |
Jean-Baptiste Queru | 7e82c95 | 2012-06-19 08:03:45 -0700 | [diff] [blame] | 21 | # 386704 = JRN80 |
Jean-Baptiste Queru | 36565c0 | 2012-06-23 09:39:26 -0700 | [diff] [blame] | 22 | # 391496 = JRN83D |
Jean-Baptiste Queru | d20e452 | 2012-07-04 10:34:37 -0700 | [diff] [blame] | 23 | # 397816 = JRO03B |
Jean-Baptiste Queru | a37b22f | 2012-07-04 17:10:39 -0700 | [diff] [blame] | 24 | # 398337 = JRO03C |
Jean-Baptiste Queru | db72e39 | 2012-08-01 14:51:37 -0700 | [diff] [blame] | 25 | # 405518 = JRO03H |
Jean-Baptiste Queru | 042f71f | 2012-09-21 13:48:27 -0700 | [diff] [blame] | 26 | # 438695 = JRO03R |
Jean-Baptiste Queru | 7b1de31 | 2012-09-17 08:30:17 -0700 | [diff] [blame] | 27 | # 463694 = JZO54G |
Jean-Baptiste Queru | 734bf8a | 2012-10-02 15:40:15 -0700 | [diff] [blame] | 28 | # 485486 = JZO54K |
Jean-Baptiste Queru | 36565c0 | 2012-06-23 09:39:26 -0700 | [diff] [blame] | 29 | # end jb-dev |
Jean-Baptiste Queru | 3580910 | 2012-11-02 13:31:12 -0700 | [diff] [blame] | 30 | # start jb-mr1-dev |
| 31 | # 521994 = JOP32B |
Jean-Baptiste Queru | 6232c64 | 2012-11-06 09:26:07 -0800 | [diff] [blame] | 32 | # 524024 = JOP36 |
Jean-Baptiste Queru | a78ca9b | 2012-11-09 13:27:24 -0800 | [diff] [blame] | 33 | # 527221 = JOP40 |
Jean-Baptiste Queru | 7b797c3 | 2012-11-12 08:34:37 -0800 | [diff] [blame] | 34 | # 527662 = JOP40C |
Jean-Baptiste Queru | e8d35a7 | 2013-01-29 17:15:34 -0800 | [diff] [blame] | 35 | # 561924 = JOP40G |
Jean-Baptiste Queru | 3580910 | 2012-11-02 13:31:12 -0700 | [diff] [blame] | 36 | # end jb-mr1-dev |
Jean-Baptiste Queru | 829187c | 2012-12-27 08:43:02 -0800 | [diff] [blame] | 37 | # start jb-mr1.1-dev |
| 38 | # 551245 = JDP82 |
Jean-Baptiste Queru | ad05105 | 2013-02-14 14:11:18 -0800 | [diff] [blame] | 39 | # 573038 = JDQ39 |
Jean-Baptiste Queru | 829187c | 2012-12-27 08:43:02 -0800 | [diff] [blame] | 40 | # end jb-mr1.1-dev |
Jean-Baptiste Queru | 44d1b34 | 2013-04-12 12:45:25 -0700 | [diff] [blame] | 41 | # start jb-mr2-dev |
| 42 | # 638589 = JWR11D |
Jean-Baptiste Queru | f93f6db | 2013-05-20 15:21:04 -0700 | [diff] [blame] | 43 | # 681336 = JWR50 |
Jean-Baptiste Queru | 6e905c5 | 2013-05-21 11:09:05 -0700 | [diff] [blame] | 44 | # 683083 = JWR51 |
Jean-Baptiste Queru | b98892b | 2013-05-22 17:42:30 -0700 | [diff] [blame] | 45 | # 684634 = JWR52 |
Jean-Baptiste Queru | d80c654 | 2013-05-23 09:16:10 -0700 | [diff] [blame] | 46 | # 686185 = JWR53 |
Jean-Baptiste Queru | 3dbe55f | 2013-05-28 09:20:51 -0700 | [diff] [blame] | 47 | # 689345 = JWR58 |
Jean-Baptiste Queru | 79dfd1e | 2013-05-29 08:53:21 -0700 | [diff] [blame] | 48 | # 690834 = JWR59 |
Jean-Baptiste Queru | 6528168 | 2013-05-30 09:42:38 -0700 | [diff] [blame] | 49 | # 692263 = JWR60 |
Jean-Baptiste Queru | fa65fc2 | 2013-06-03 08:04:32 -0700 | [diff] [blame] | 50 | # 695489 = JWR64 |
Jean-Baptiste Queru | 2fcf0bb | 2013-06-06 12:06:48 -0700 | [diff] [blame] | 51 | # 699533 = JWR66 |
Jean-Baptiste Queru | 808b9a2 | 2013-06-07 09:36:16 -0700 | [diff] [blame] | 52 | # 701448 = JWR66C |
Jean-Baptiste Queru | 7c3fc54 | 2013-06-11 08:32:50 -0700 | [diff] [blame] | 53 | # 704243 = JWR66G |
Jean-Baptiste Queru | 1f2970c | 2013-06-16 10:16:02 -0700 | [diff] [blame] | 54 | # 711294 = JWR66N |
Jean-Baptiste Queru | 6a21b86 | 2013-07-10 15:34:33 -0700 | [diff] [blame] | 55 | # 736095 = JWR66U |
Jean-Baptiste Queru | 555e4db | 2013-07-11 15:10:50 -0700 | [diff] [blame] | 56 | # 737497 = JWR66V |
Jean-Baptiste Queru | 44d1b34 | 2013-04-12 12:45:25 -0700 | [diff] [blame] | 57 | # end jb-mr2-dev |
Conley Owens | 8782853 | 2013-12-10 16:33:19 -0800 | [diff] [blame] | 58 | BRANCH=klp-dev |
Jean-Baptiste Queru | e8d35a7 | 2013-01-29 17:15:34 -0800 | [diff] [blame] | 59 | if test $BRANCH = jb-dev |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 60 | then |
Jean-Baptiste Queru | 734bf8a | 2012-10-02 15:40:15 -0700 | [diff] [blame] | 61 | ZIP=nakasi-ota-485486.zip |
| 62 | BUILD=jzo54k |
Jean-Baptiste Queru | 36565c0 | 2012-06-23 09:39:26 -0700 | [diff] [blame] | 63 | fi # jb-dev |
Jean-Baptiste Queru | e8d35a7 | 2013-01-29 17:15:34 -0800 | [diff] [blame] | 64 | if test $BRANCH = jb-mr1-dev |
Jean-Baptiste Queru | 3580910 | 2012-11-02 13:31:12 -0700 | [diff] [blame] | 65 | then |
Jean-Baptiste Queru | e8d35a7 | 2013-01-29 17:15:34 -0800 | [diff] [blame] | 66 | ZIP=nakasi-ota-561924.zip |
| 67 | BUILD=jop40g |
Jean-Baptiste Queru | 3580910 | 2012-11-02 13:31:12 -0700 | [diff] [blame] | 68 | fi # jb-mr1-dev |
Jean-Baptiste Queru | e8d35a7 | 2013-01-29 17:15:34 -0800 | [diff] [blame] | 69 | if test $BRANCH = jb-mr1.1-dev |
Jean-Baptiste Queru | 829187c | 2012-12-27 08:43:02 -0800 | [diff] [blame] | 70 | then |
Jean-Baptiste Queru | ad05105 | 2013-02-14 14:11:18 -0800 | [diff] [blame] | 71 | ZIP=nakasi-ota-573038.zip |
| 72 | BUILD=jdq39 |
Jean-Baptiste Queru | 829187c | 2012-12-27 08:43:02 -0800 | [diff] [blame] | 73 | fi # jb-mr1.1-dev |
Jean-Baptiste Queru | 44d1b34 | 2013-04-12 12:45:25 -0700 | [diff] [blame] | 74 | if test $BRANCH = jb-mr2-dev |
| 75 | then |
Jean-Baptiste Queru | 555e4db | 2013-07-11 15:10:50 -0700 | [diff] [blame] | 76 | ZIP=nakasi-ota-737497 |
| 77 | BUILD=jwr66v |
Jean-Baptiste Queru | 44d1b34 | 2013-04-12 12:45:25 -0700 | [diff] [blame] | 78 | fi # jb-mr2-dev |
Conley Owens | 8782853 | 2013-12-10 16:33:19 -0800 | [diff] [blame] | 79 | if test $BRANCH = klp-dev |
| 80 | then |
| 81 | ZIP=nakasi-ota-937116 |
| 82 | BUILD=kot49h |
| 83 | fi # klp-dev |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 84 | ROOTDEVICE=grouper |
| 85 | DEVICE=grouper |
| 86 | MANUFACTURER=asus |
| 87 | |
Jean-Baptiste Queru | ad05105 | 2013-02-14 14:11:18 -0800 | [diff] [blame] | 88 | for COMPANY in asus broadcom elan invensense nvidia nxp widevine |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 89 | do |
| 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 Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 96 | asus) |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 97 | TO_EXTRACT="\ |
Jean-Baptiste Queru | 7b1de31 | 2012-09-17 08:30:17 -0700 | [diff] [blame] | 98 | system/bin/sensors-config \ |
Jean-Baptiste Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 99 | system/lib/hw/camera.tegra3.so \ |
Jean-Baptiste Queru | 7b1de31 | 2012-09-17 08:30:17 -0700 | [diff] [blame] | 100 | system/lib/hw/sensors.grouper.so \ |
Jean-Baptiste Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 101 | system/lib/libsensors.lightsensor.so \ |
Jean-Baptiste Queru | 7e82c95 | 2012-06-19 08:03:45 -0700 | [diff] [blame] | 102 | system/vendor/lib/drm/libdrmwvmplugin.so \ |
| 103 | system/vendor/lib/libwvm.so \ |
Jean-Baptiste Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 104 | " |
| 105 | ;; |
Jean-Baptiste Queru | b4a6000 | 2012-07-04 09:26:18 -0700 | [diff] [blame] | 106 | broadcom) |
| 107 | TO_EXTRACT="\ |
Jean-Baptiste Queru | 7b1de31 | 2012-09-17 08:30:17 -0700 | [diff] [blame] | 108 | system/bin/glgps \ |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 109 | system/etc/firmware/bcm4330.hcd \ |
Jean-Baptiste Queru | 7b1de31 | 2012-09-17 08:30:17 -0700 | [diff] [blame] | 110 | system/etc/gps/gpsconfig.xml \ |
| 111 | system/lib/hw/gps.tegra3.so \ |
Jean-Baptiste Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 112 | " |
| 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 Queru | ad05105 | 2013-02-14 14:11:18 -0800 | [diff] [blame] | 128 | system/bin/tf_daemon \ |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 129 | 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 Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 134 | 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 Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 139 | system/lib/hw/gralloc.tegra3.so \ |
| 140 | system/lib/hw/hwcomposer.tegra3.so \ |
Jean-Baptiste Queru | 7e82c95 | 2012-06-19 08:03:45 -0700 | [diff] [blame] | 141 | system/lib/libardrv_dynamic.so \ |
| 142 | system/lib/libcgdrv.so \ |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 143 | 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 Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 183 | system/lib/libstagefrighthw.so \ |
| 184 | system/lib/libtf_crypto_sst.so \ |
Jean-Baptiste Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 185 | " |
| 186 | ;; |
| 187 | nxp) |
| 188 | TO_EXTRACT="\ |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 189 | system/vendor/firmware/libpn544_fw.so \ |
Jean-Baptiste Queru | 669b742 | 2012-06-05 08:12:15 -0700 | [diff] [blame] | 190 | " |
| 191 | ;; |
| 192 | widevine) |
| 193 | TO_EXTRACT="\ |
Jean-Baptiste Queru | 7e82c95 | 2012-06-19 08:03:45 -0700 | [diff] [blame] | 194 | system/lib/libdrmdecrypt.so \ |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 195 | system/vendor/lib/libwvdrm_L1.so \ |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 196 | system/vendor/lib/libWVStreamControlAPI_L1.so |
| 197 | " |
| 198 | ;; |
Jean-Baptiste Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 199 | 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 Queru | b1ae9e5 | 2012-06-01 08:40:39 -0700 | [diff] [blame] | 209 | 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 |
| 230 | done |