X-Git-Url: http://git.rot13.org/?p=android-command-line.git;a=blobdiff_plain;f=adb-install-update.sh;fp=adb-install-update.sh;h=978490ce0c4e26f0366d6dcf4319898b8c9e0230;hp=0000000000000000000000000000000000000000;hb=d8d79ec060727394515adaec93a764ab938968b5;hpb=2b584a6824cc543d3a4c45f822f7c4a12fc52764;ds=sidebyside diff --git a/adb-install-update.sh b/adb-install-update.sh new file mode 100755 index 0000000..978490c --- /dev/null +++ b/adb-install-update.sh @@ -0,0 +1,28 @@ +#!/bin/sh -x + +# The recovery tool communicates with the main system through /cache files. +# /cache/recovery/command - INPUT - command line for tool, one arg per line +# /cache/recovery/log - OUTPUT - combined log file from recovery run(s) +# /cache/recovery/intent - OUTPUT - intent that was passed in +# +# The arguments which may be supplied in the recovery.command file: +# --send_intent=anystring - write the text out to recovery.intent +# --update_package=root:path - verify install an OTA package file +# --wipe_data - erase user data (and cache), then reboot +# --wipe_cache - wipe cache (but not user data), then reboot +# +# After completing, we remove /cache/recovery/command and reboot. + +if [ ! -e "$1" ] ; then + echo "Usage: $0 update.zip" + exit 1 +fi + +#adb push $1 /sdcard/update.zip + +adb remount +adb shell "echo 'boot-recovery ' > /cache/recovery/command" +adb shell "echo '--update_package=/sdcard/update.zip' >> /cache/recovery/command" +#adb shell "echo '--wipe_cache' >> /cache/recovery/command" +adb shell "echo 'reboot' >> /cache/recovery/command" +adb shell "reboot recovery"