charansingh | d204b68 | 2011-02-02 01:35:29 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | export LOC="$PWD/out/target/product/leo" |
| 4 | |
| 5 | mkdir -p "$LOC"/temp |
| 6 | |
| 7 | cd "$LOC"/temp |
| 8 | echo "extract update.zip" |
Ladios Jonquil | 1f76513 | 2011-09-25 02:11:08 +0800 | [diff] [blame] | 9 | unzip -o -qq "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip |
charansingh | d204b68 | 2011-02-02 01:35:29 +0530 | [diff] [blame] | 10 | |
| 11 | echo "Making Leo Compatible Update script" |
| 12 | cd "$LOC" |
| 13 | cd "$LOC"/temp/META-INF/com/google/android |
| 14 | echo 'mount("yaffs2", "MTD", "boot", "/boot");' >> temp |
| 15 | echo 'package_extract_dir("boot", "/boot");' >> temp |
| 16 | grep -vw assert updater-script >> temp |
| 17 | rm -rf updater-script |
| 18 | grep -vw boot.img temp > updater-script |
| 19 | rm -rf temp |
| 20 | echo Zipping Package |
| 21 | cd "$LOC"/temp |
charansingh | 5ef6804 | 2011-03-27 17:23:20 +0530 | [diff] [blame] | 22 | rm -rf "$LOC"/temp/boot.img |
| 23 | rm -rf "$LOC"/temp/boot |
| 24 | cp -a "$LOC"/boot "$LOC"/temp/boot |
Arif Ali | c5217ce | 2011-09-28 01:05:04 +0100 | [diff] [blame^] | 25 | if [[ ! -e "$LOC"/temp/boot/initrd.gz ]] ; then |
| 26 | cp -a "$LOC"/ramdisk.img "$LOC"/temp/boot/initrd.gz |
| 27 | fi |
Ladios Jonquil | 1f76513 | 2011-09-25 02:11:08 +0800 | [diff] [blame] | 28 | rm -rf "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip |
| 29 | zip -9yr "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip * > /dev/null |
charansingh | d204b68 | 2011-02-02 01:35:29 +0530 | [diff] [blame] | 30 | cd "$LOC" |
| 31 | |
| 32 | echo Cleanup... |
| 33 | rm -rf "$LOC"/temp |
| 34 | |
| 35 | echo done |