1 # Copyright (C) 2011 The Android Open Source Project
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 if test "$RADIOSRC" = ""
19 if test "$BOOTLOADERSRC" = ""
21 BOOTLOADERSRC=bootloader.img
24 mkdir -p tmp/$PRODUCT-$VERSION
25 unzip -d tmp signed-$PRODUCT-target_files-$BUILD.zip RADIO/$RADIOSRC RADIO/$BOOTLOADERSRC
26 if test "$CDMARADIO" != ""
28 unzip -d tmp signed-$PRODUCT-target_files-$BUILD.zip RADIO/radio-cdma.img
30 cp signed-$PRODUCT-img-$BUILD.zip tmp/$PRODUCT-$VERSION/image-$PRODUCT-$VERSION.zip
31 cp tmp/RADIO/$BOOTLOADERSRC tmp/$PRODUCT-$VERSION/bootloader-$DEVICE-$BOOTLOADER.img
32 cp tmp/RADIO/$RADIOSRC tmp/$PRODUCT-$VERSION/radio-$DEVICE-$RADIO.img
33 if test "$CDMARADIO" != ""
35 cp tmp/RADIO/radio-cdma.img tmp/$PRODUCT-$VERSION/radio-cdma-$DEVICE-$CDMARADIO.img
37 cat > tmp/$PRODUCT-$VERSION/flash-all.sh << EOF
40 # Copyright (C) 2011 The Android Open Source Project
42 # Licensed under the Apache License, Version 2.0 (the "License");
43 # you may not use this file except in compliance with the License.
44 # You may obtain a copy of the License at
46 # http://www.apache.org/licenses/LICENSE-2.0
48 # Unless required by applicable law or agreed to in writing, software
49 # distributed under the License is distributed on an "AS IS" BASIS,
50 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51 # See the License for the specific language governing permissions and
52 # limitations under the License.
54 fastboot flash bootloader bootloader-$DEVICE-$BOOTLOADER.img
55 fastboot reboot-bootloader
57 fastboot flash radio radio-$DEVICE-$RADIO.img
58 fastboot reboot-bootloader
61 if test "$CDMARADIO" != ""
63 cat >> tmp/$PRODUCT-$VERSION/flash-all.sh << EOF
64 fastboot flash radio-cdma radio-cdma-$DEVICE-$CDMARADIO.img
65 fastboot reboot-bootloader
69 cat >> tmp/$PRODUCT-$VERSION/flash-all.sh << EOF
70 fastboot -w update image-$PRODUCT-$VERSION.zip
72 chmod a+x tmp/$PRODUCT-$VERSION/flash-all.sh
73 cat > tmp/$PRODUCT-$VERSION/flash-base.sh << EOF
76 # Copyright (C) 2011 The Android Open Source Project
78 # Licensed under the Apache License, Version 2.0 (the "License");
79 # you may not use this file except in compliance with the License.
80 # You may obtain a copy of the License at
82 # http://www.apache.org/licenses/LICENSE-2.0
84 # Unless required by applicable law or agreed to in writing, software
85 # distributed under the License is distributed on an "AS IS" BASIS,
86 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87 # See the License for the specific language governing permissions and
88 # limitations under the License.
90 fastboot flash bootloader bootloader-$DEVICE-$BOOTLOADER.img
91 fastboot reboot-bootloader
93 fastboot flash radio radio-$DEVICE-$RADIO.img
94 fastboot reboot-bootloader
97 if test "$CDMARADIO" != ""
99 cat >> tmp/$PRODUCT-$VERSION/flash-base.sh << EOF
100 fastboot flash radio-cdma radio-cdma-$DEVICE-$CDMARADIO.img
101 fastboot reboot-bootloader
105 chmod a+x tmp/$PRODUCT-$VERSION/flash-base.sh
106 (cd tmp ; tar zcvf ../$PRODUCT-$VERSION-factory.tgz $PRODUCT-$VERSION)
107 mv $PRODUCT-$VERSION-factory.tgz $PRODUCT-$VERSION-factory-$(sha1sum < $PRODUCT-$VERSION-factory.tgz | cut -b -8).tgz