blob: 5e2ae104a79f0a187d74dab08f14cec65ee95a0e [file] [log] [blame]
charansinghd204b682011-02-02 01:35:29 +05301#!/bin/bash
2
3export LOC="$PWD/out/target/product/leo"
4
5mkdir -p "$LOC"/temp
6
7cd "$LOC"/temp
8echo "extract update.zip"
Ladios Jonquil1f765132011-09-25 02:11:08 +08009unzip -o -qq "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip
charansinghd204b682011-02-02 01:35:29 +053010
11echo "Making Leo Compatible Update script"
12cd "$LOC"
13cd "$LOC"/temp/META-INF/com/google/android
14echo 'mount("yaffs2", "MTD", "boot", "/boot");' >> temp
15echo 'package_extract_dir("boot", "/boot");' >> temp
16grep -vw assert updater-script >> temp
17rm -rf updater-script
18grep -vw boot.img temp > updater-script
19rm -rf temp
20echo Zipping Package
21cd "$LOC"/temp
charansingh5ef68042011-03-27 17:23:20 +053022rm -rf "$LOC"/temp/boot.img
23rm -rf "$LOC"/temp/boot
24cp -a "$LOC"/boot "$LOC"/temp/boot
Arif Alic5217ce2011-09-28 01:05:04 +010025if [[ ! -e "$LOC"/temp/boot/initrd.gz ]] ; then
26 cp -a "$LOC"/ramdisk.img "$LOC"/temp/boot/initrd.gz
27fi
Ladios Jonquil1f765132011-09-25 02:11:08 +080028rm -rf "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip
29zip -9yr "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip * > /dev/null
charansinghd204b682011-02-02 01:35:29 +053030cd "$LOC"
31
32echo Cleanup...
33rm -rf "$LOC"/temp
34
35echo done