diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-04-19 08:44:21 -0700 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2012-04-19 08:44:21 -0700 |
commit | 9cb1b4a67ef2a9c0a487606aee8f11f2c906a84b (patch) | |
tree | 8d06d2ca468da5fe8433dc5aa7d597ff5ddb6984 | |
parent | 10df27a2b127322175bcf49a57ef8c7b0a2b2fcb (diff) | |
download | device_common-9cb1b4a67ef2a9c0a487606aee8f11f2c906a84b.zip device_common-9cb1b4a67ef2a9c0a487606aee8f11f2c906a84b.tar.gz device_common-9cb1b4a67ef2a9c0a487606aee8f11f2c906a84b.tar.bz2 |
Fine-tune the generation of factory images
Change-Id: I574bdab542a30931016db532e529386b4e4ef0d1
-rw-r--r-- | clear-factory-images-variables.sh | 23 | ||||
-rw-r--r-- | generate-factory-images-common.sh | 41 |
2 files changed, 54 insertions, 10 deletions
diff --git a/clear-factory-images-variables.sh b/clear-factory-images-variables.sh new file mode 100644 index 0000000..5528938 --- /dev/null +++ b/clear-factory-images-variables.sh @@ -0,0 +1,23 @@ +# Copyright 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +unset BOOTLOADER +unset BOOTLOADERSRC +unset BUILD +unset CDMARADIO +unset PRODUCT +unset RADIO +unset RADIOSRC +unset SRCPREFIX +unset VERSION diff --git a/generate-factory-images-common.sh b/generate-factory-images-common.sh index 95441a6..ef58ae4 100644 --- a/generate-factory-images-common.sh +++ b/generate-factory-images-common.sh @@ -22,18 +22,29 @@ then fi rm -rf tmp mkdir -p tmp/$PRODUCT-$VERSION -unzip -d tmp signed-$PRODUCT-target_files-$BUILD.zip RADIO/$RADIOSRC RADIO/$BOOTLOADERSRC +unzip -d tmp ${SRCPREFIX}$PRODUCT-target_files-$BUILD.zip RADIO/$BOOTLOADERSRC +if test "$RADIO" != "" +then + unzip -d tmp ${SRCPREFIX}$PRODUCT-target_files-$BUILD.zip RADIO/$RADIOSRC +fi if test "$CDMARADIO" != "" then - unzip -d tmp signed-$PRODUCT-target_files-$BUILD.zip RADIO/radio-cdma.img + unzip -d tmp ${SRCPREFIX}$PRODUCT-target_files-$BUILD.zip RADIO/radio-cdma.img fi -cp signed-$PRODUCT-img-$BUILD.zip tmp/$PRODUCT-$VERSION/image-$PRODUCT-$VERSION.zip +cp ${SRCPREFIX}$PRODUCT-img-$BUILD.zip tmp/$PRODUCT-$VERSION/image-$PRODUCT-$VERSION.zip cp tmp/RADIO/$BOOTLOADERSRC tmp/$PRODUCT-$VERSION/bootloader-$DEVICE-$BOOTLOADER.img -cp tmp/RADIO/$RADIOSRC tmp/$PRODUCT-$VERSION/radio-$DEVICE-$RADIO.img +if test "$RADIO" != "" +then + cp tmp/RADIO/$RADIOSRC tmp/$PRODUCT-$VERSION/radio-$DEVICE-$RADIO.img +fi if test "$CDMARADIO" != "" then cp tmp/RADIO/radio-cdma.img tmp/$PRODUCT-$VERSION/radio-cdma-$DEVICE-$CDMARADIO.img fi +if test "$SLEEPDURATION" = "" +then + SLEEPDURATION=5 +fi cat > tmp/$PRODUCT-$VERSION/flash-all.sh << EOF #!/bin/sh @@ -53,17 +64,22 @@ cat > tmp/$PRODUCT-$VERSION/flash-all.sh << EOF fastboot flash bootloader bootloader-$DEVICE-$BOOTLOADER.img fastboot reboot-bootloader -sleep 5 +sleep $SLEEPDURATION +EOF +if test "$RADIO" != "" +then +cat >> tmp/$PRODUCT-$VERSION/flash-all.sh << EOF fastboot flash radio radio-$DEVICE-$RADIO.img fastboot reboot-bootloader -sleep 5 +sleep $SLEEPDURATION EOF +fi if test "$CDMARADIO" != "" then cat >> tmp/$PRODUCT-$VERSION/flash-all.sh << EOF fastboot flash radio-cdma radio-cdma-$DEVICE-$CDMARADIO.img fastboot reboot-bootloader -sleep 5 +sleep $SLEEPDURATION EOF fi cat >> tmp/$PRODUCT-$VERSION/flash-all.sh << EOF @@ -89,17 +105,22 @@ cat > tmp/$PRODUCT-$VERSION/flash-base.sh << EOF fastboot flash bootloader bootloader-$DEVICE-$BOOTLOADER.img fastboot reboot-bootloader -sleep 5 +sleep $SLEEPDURATION +EOF +if test "$RADIO" != "" +then +cat >> tmp/$PRODUCT-$VERSION/flash-base.sh << EOF fastboot flash radio radio-$DEVICE-$RADIO.img fastboot reboot-bootloader -sleep 5 +sleep $SLEEPDURATION EOF +fi if test "$CDMARADIO" != "" then cat >> tmp/$PRODUCT-$VERSION/flash-base.sh << EOF fastboot flash radio-cdma radio-cdma-$DEVICE-$CDMARADIO.img fastboot reboot-bootloader -sleep 5 +sleep $SLEEPDURATION EOF fi chmod a+x tmp/$PRODUCT-$VERSION/flash-base.sh |