3 # The recovery tool communicates with the main system through /cache files.
4 # /cache/recovery/command - INPUT - command line for tool, one arg per line
5 # /cache/recovery/log - OUTPUT - combined log file from recovery run(s)
6 # /cache/recovery/intent - OUTPUT - intent that was passed in
8 # The arguments which may be supplied in the recovery.command file:
9 # --send_intent=anystring - write the text out to recovery.intent
10 # --update_package=root:path - verify install an OTA package file
11 # --wipe_data - erase user data (and cache), then reboot
12 # --wipe_cache - wipe cache (but not user data), then reboot
14 # After completing, we remove /cache/recovery/command and reboot.
16 if [ ! -e "$1" ] ; then
17 echo "Usage: $0 update.zip"
21 adb shell "rm /sdcard/update.zip"
23 adb push $1 /sdcard/update.zip || exit 1
26 adb shell "echo 'boot-recovery ' > /cache/recovery/command"
27 adb shell "echo '--update_package=/sdcard/update.zip' >> /cache/recovery/command"
28 adb shell "echo '--wipe_cache' >> /cache/recovery/command"
29 adb shell "echo 'reboot' >> /cache/recovery/command"
30 adb shell "reboot recovery"