2011-02-01 20:05:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export LOC="$PWD/out/target/product/leo"
|
|
|
|
|
|
|
|
mkdir -p "$LOC"/temp
|
|
|
|
|
|
|
|
cd "$LOC"/temp
|
|
|
|
echo "extract update.zip"
|
2011-09-24 18:11:08 +00:00
|
|
|
unzip -o -qq "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip
|
2011-02-01 20:05:29 +00:00
|
|
|
|
|
|
|
echo "Making Leo Compatible Update script"
|
|
|
|
cd "$LOC"
|
|
|
|
cd "$LOC"/temp/META-INF/com/google/android
|
|
|
|
echo 'mount("yaffs2", "MTD", "boot", "/boot");' >> temp
|
|
|
|
echo 'package_extract_dir("boot", "/boot");' >> temp
|
|
|
|
grep -vw assert updater-script >> temp
|
|
|
|
rm -rf updater-script
|
|
|
|
grep -vw boot.img temp > updater-script
|
|
|
|
rm -rf temp
|
|
|
|
echo Zipping Package
|
|
|
|
cd "$LOC"/temp
|
2011-03-27 11:53:20 +00:00
|
|
|
rm -rf "$LOC"/temp/boot.img
|
|
|
|
rm -rf "$LOC"/temp/boot
|
|
|
|
cp -a "$LOC"/boot "$LOC"/temp/boot
|
2011-09-28 00:05:04 +00:00
|
|
|
if [[ ! -e "$LOC"/temp/boot/initrd.gz ]] ; then
|
|
|
|
cp -a "$LOC"/ramdisk.img "$LOC"/temp/boot/initrd.gz
|
|
|
|
fi
|
2011-09-24 18:11:08 +00:00
|
|
|
rm -rf "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip
|
|
|
|
zip -9yr "$LOC"/$TARGET_PRODUCT-ota-$TARGET_BUILD_VARIANT.$USER.zip * > /dev/null
|
2011-02-01 20:05:29 +00:00
|
|
|
cd "$LOC"
|
|
|
|
|
|
|
|
echo Cleanup...
|
|
|
|
rm -rf "$LOC"/temp
|
|
|
|
|
|
|
|
echo done
|