diff options
author | Steve Kondik <shade@chemlab.org> | 2013-04-13 07:19:52 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 16:12:11 -0700 |
commit | 464574f63ebc1b88100b4b98fb4aadc3734383c2 (patch) | |
tree | 16e39b4e4992cd3211768f79b0df5f7bfa0e4ed3 /envsetup.sh | |
parent | 4018e84b008e2cad3f2e5c964d8b30934c8ea255 (diff) | |
download | build-464574f63ebc1b88100b4b98fb4aadc3734383c2.zip build-464574f63ebc1b88100b4b98fb4aadc3734383c2.tar.gz build-464574f63ebc1b88100b4b98fb4aadc3734383c2.tar.bz2 |
eat: Eat using adb sideload
* Requires new recovery and updated adbd
Change-Id: I65990822ab63313701d74783d95611d128d90f94
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/envsetup.sh b/envsetup.sh index 05035be..01b657c 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -748,28 +748,16 @@ function eat() adb root sleep 1 adb wait-for-device - SZ=`stat -c %s $ZIPPATH` - CACHESIZE=`adb shell busybox df -PB1 /cache | grep /cache | tr -s ' ' | cut -d ' ' -f 4` - if [ $CACHESIZE -gt $SZ ]; - then - PUSHDIR=/cache/ - DIR=cache - else - PUSHDIR=/storage/sdcard0/ - # Optional path for sdcard0 in recovery - [ -z "$1" ] && DIR=sdcard/0 || DIR=$1 - fi - echo "Pushing $ZIPFILE to $PUSHDIR" - if adb push $ZIPPATH $PUSHDIR ; then - cat << EOF > /tmp/command ---update_package=/$DIR/$ZIPFILE + cat << EOF > /tmp/command +--sideload EOF - if adb push /tmp/command /cache/recovery/ ; then - echo "Rebooting into recovery for installation" - adb reboot recovery - fi - rm /tmp/command + if adb push /tmp/command /cache/recovery/ ; then + echo "Rebooting into recovery for sideload installation" + adb reboot recovery + adb wait-for-sideload + adb sideload $ZIPPATH fi + rm /tmp/command else echo "Nothing to eat" return 1 |