Commit graph

46 commits

Author SHA1 Message Date
Doug Zongker
10e418d3c8 turn recovery into a C++ binary
Change-Id: I68a67a4c8edec9a74463b3d4766005ce27b51316
2011-10-28 10:33:05 -07:00
Doug Zongker
d0181b8fcd allow recovery packages to wipe cache
updater now has a function "wipe_cache();" which causes recovery to
wipe the cache partition after the successful installation of the
package.  Move log copying around a bit so logs and the last_install
flag file are copied to cache after it's wiped.

Bug: 5314244
Change-Id: Id35a9eb6dcd626c8f3a3a0076074f462ed3d44bd
2011-10-19 11:26:18 -07:00
Michael Ward
9d2629c1c4 Allow applying an OTA package manually from cache.
Change-Id: I8f78377555c658a992ca95cadf11b67ddc93fed8
2011-06-24 11:53:58 -07:00
Doug Zongker
469243e536 save a last_install file with the result of the last package install attempt
When installing a package, create /cache/recovery/last_install, which
contains the filename of the package and a 1 or 0 for success or
failure.

Also, don't mount ext4 and vfat filesystems as read-only (on devices
where /cache is ext4, we need it to be read-write).

Change-Id: I0cf2a1921bbd65e06343aa74e2006577fac77c2c
2011-04-12 09:28:10 -07:00
Ken Sumrall
6e4472abbd Have recovery reboot using the new android_reboot() function.
The new android_reboot() function is a nicer way to reboot the
system.  I can optionally sync() and remount read-only writable
filesystems.  This fixes bug 3350709.

Change-Id: Ic4c8676debd642e57bce3107b99dd810d90b6f82
2011-03-10 19:30:13 -08:00
Doug Zongker
6809c51f8d make recovery UI images more general; allow for installation animation
Change some of the UI parameters (# of indeterminate progress bar
frames, fps, etc.) from #defined constants to variables that can be
set by the device-specific recovery_ui code (via a new function).

Support overlaying different images on top of the base installation
icon to animate it.  Make the FPS control more accurate.

Change-Id: I9268b389b7ea6b3ed9e0c7eae37baf4272e60edd
2011-03-01 14:04:34 -08:00
Doug Zongker
6da1abbc38 am 5df22d03: am 5cae445e: make recovery reboot after 2 minutes of no activity
* commit '5df22d03d2e7c6de213d83a58e0af39c42f839ca':
  make recovery reboot after 2 minutes of no activity
2011-01-25 13:56:07 -08:00
Doug Zongker
5cae445e43 make recovery reboot after 2 minutes of no activity
If recovery sits for 2 minutes in prompt_and_wait(), and you've never
turned the screen on via the magic keypress, go ahead and reboot.  (We
used to assume that the user could pull the battery to get out of this
state, but on devices with nonremovable batteries...)

If you've ever enabled display of the log/menu since recovery started,
we assume you know what you're doing and will stay in recovery until
you choose to reboot.

Bug: 3387873
Bug: 3387274
Change-Id: I041621e5db132df9a925e6808845a7c45e1b427a
2011-01-25 13:50:16 -08:00
Doug Zongker
540d57f25a remove encrypted filesystem code from recovery
This was never used; encrypted filesystems are being done a different
way now.

Change-Id: I519c57b9be44d001f0b81516af7bfc252069892b
2011-01-18 13:36:58 -08:00
Doug Zongker
51266d1397 clear recovery framebuffers on allocation; display icon right after ui_init
Make ui_init() clear the framebuffer memory it maps in so the user
isn't treated to a visible flash of random bits on recovery startup.
Call ui_set_background() (to show the installing icon) right after
ui_init() to display something while device_recovery_start() is
working (which can take a second or two on some devices).

Bug: 3145331
Change-Id: I11e7859fab5847370ea4f4932c3fb1558af26c5d
2010-11-01 10:19:12 -07:00
Doug Zongker
2c3539e4d8 save the log from recovery's last run in /cache/recovery/last_log
Also, don't lose the start of the log whenever a wipe cache is
performed.

Change-Id: I29999762854eb36d1ff2bc20b4183c9077b19777
2010-09-29 13:40:44 -07:00
Doug Zongker
9b125b04c6 handle old-style CACHE: packages
Change-Id: I7bf52b56770c207ba1c8329243991b07ebb65779
2010-09-22 12:01:37 -07:00
Doug Zongker
c18eeb874b mount sdcard only on demand; fix sideload installs
Bug: 3009493
Change-Id: I1a7f99fc41a6a7012742e82f8c06a0c75584890a
2010-09-21 16:58:10 -07:00
Doug Zongker
d4208f9f9d remove the notion of "root path"; support mixed flash types (do not merge)
Remove the wacky notion of "roots" and "root paths" (those things that
look like "FOO:some/path" instead of just "/foo/some/path").  Let each
device specify its own table of available partitions and how to mount
them (needed for devices that use both MTD/yaffs2 and EMMC/ext4
partitions).

Change-Id: I18b0a572a71c5e087e0b7ae11b1774388339bfd1
2010-09-20 18:07:31 -07:00
Doug Zongker
56c5105bd7 support for ext4/EMMC filesystems in updater binary
Make the mount and format functions take extra parameters describing
the filesystem type and add support for mounting and formatting ext4
filesystems on EMMC.

Change recovery to consistently use stdout for status messages instead
of mixing stdout and stderr.
2010-09-15 11:10:02 -07:00
Doug Zongker
8674a726ff (cherry-pick) support installing any .zip file on the sdcard
Replaces the "install sdcard:update zip" menu option with one that
displays a menu of zip files (and subdirs) on the sdcard and lets you
pick which one to install.

Change-Id: Icff541525f2fdfc8939a91af626ecc386ac9dd07
2010-09-15 11:08:23 -07:00
Doug Zongker
4bc980626c add --show_text option to recovery
Change-Id: Ie6c6c920260dfa759fbb15b1f352d6bb0fa7146c
2010-09-03 11:18:36 -07:00
Ying Wang
532c86002b Revert 21f0f97eba
Change-Id: I46e4d7fe76e4219207e46f19e50188e38bb932b7
2010-09-01 14:52:22 -07:00
Ying Wang
21f0f97eba Fix for crespo.
Change-Id: I008510bf614606a46a630c7adc39464ce1143ec3
2010-08-30 17:26:53 -07:00
Doug Zongker
23ceeea85e make a copy of sideloaded packages in /tmp before verifying
Copy a sideloaded package into /tmp, then verify and install the copy,
to prevent malicious users from overwriting the package between
verification and install.

Bug: 2826890 package can be replaced during verification
Bug: 2058160 Recovery should copy sideloaded (sd card) update ...
Change-Id: I3de148b0f1a671f1974782b6855527caeaefda23
2010-07-08 17:27:55 -07:00
Oscar Montemayor
52219a68a8 DO NOT MERGE
Encrypted File Systems integration. Recovery changes.

Change-Id: I932f73a6f937aac061128e1134eab08c30f0471d
2010-04-01 17:14:57 -07:00
Doug Zongker
e08991e02a bump updater API version to 3; deprecate firmware update command
Remove support for the HTC-specific "firmware" update command and the
corresponding edify function write_firmware_update().  This
functionality is now done by an edify extension library that lives in
vendor/htc.

Change-Id: I80858951ff10ed8dfff98aefb796bef009e05efb
2010-02-03 09:20:07 -08:00
Doug Zongker
efa1bab94c change log recovery to generic device_recovery_start function
Remove (or at least stop calling) the HTC-specific mechanism for
preserving the recovery log from before a radio or hboot update.
Replace it with a generic device_recovery_start() function which each
device's code can implement to do whatever it wants on recovery
startup.

Change-Id: If3cca4b498c0b1cf0565236404ecf56a1fc46123
2010-02-01 15:59:12 -08:00
Doug Zongker
687bc12ccf save the recovery log from before HTC firmware updates
When doing a firmware (radio or hboot) update on HTC devices, save the
recovery log in block 1 of the cache partition, before the firmware
image and the UI bitmaps.  When we boot back into recovery after the
firmware update to reformat the cache partition, copy that log out of
cache before reformatting it and dump it into the current invocation's
log.

The practical upshot of all this is that we can see the log output
from radio and hboot updates.

Change-Id: Ie0e89566754c88f4bed6a90d8a0aa04047b01a27
2010-01-21 12:50:04 -08:00
Oscar Montemayor
0523156775 Recovery changes for Encrypted File Systems.
This change enables/disables the Encrypted file systems feature. It reads some properties form the data partition, wipes the partition out, and then rewrites the proper properties again into the data partition to signal that encrypted FS are enabled.
2009-12-10 14:49:04 -08:00
Doug Zongker
022229c47e am 988500b6: add terminator to recovery\'s getopt_long options array
Merge commit '988500b615de24455e1fee69e72055bb1dca9c86'

* commit '988500b615de24455e1fee69e72055bb1dca9c86':
  add terminator to recovery's getopt_long options array
2009-10-12 11:45:31 -07:00
Doug Zongker
988500b615 add terminator to recovery's getopt_long options array
http://b/2170691 - recovery argument parsing is broken
2009-10-06 14:44:54 -07:00
Doug Zongker
8f8bc4cb48 am f93d8166: confirm before wiping user data in recovery
Merge commit 'f93d8166ef4c06f6ad71293ffa8a4ce469df4fa5' into eclair-plus-aosp

* commit 'f93d8166ef4c06f6ad71293ffa8a4ce469df4fa5':
  confirm before wiping user data in recovery
2009-09-22 18:28:19 -07:00
Doug Zongker
f93d8166ef confirm before wiping user data in recovery
When using the hidden menu to wipe data in recovery, confirm before
starting the wipe.  (This does not affect booting with the --wipe_data
flag, or using Alt+W on dream with the menu hidden -- those still wipe
data immediately.)
2009-09-22 18:16:56 -07:00
Jean-Baptiste Queru
cbf9038038 merge from open-source master 2009-09-01 08:27:43 -07:00
Jay Freeman (saurik)
619ec2f3aa Not all failures to fopen_root_path() are serious.
Example: E:Can't open /cache/recovery/command.
2009-08-25 12:53:40 -07:00
Doug Zongker
34c98df78a do not merge: cherry-pick of c2d666bd4f from master 2009-08-18 12:05:45 -07:00
Doug Zongker
608fa02e1a resolved conflicts for merge of 64893ccc to master 2009-07-15 18:10:28 -07:00
Doug Zongker
64893ccc09 remove amend
Yank all the code to install OTA packages out of the recovery binary
itself.  Now packages are installed by a binary included in the
package (run as a child of recovery), so we can make improvements in
the installation process without waiting for a new release to use
them.
2009-07-14 16:58:42 -07:00
Doug Zongker
b128f54d0d add function for device-specific wipe data features
Some devices want to do special things when recovery wipes data (eg,
wipe data in their baseband processor as well).  Add a hook in the
device-specific recovery library that gets called when data is wiped.

Also add an amend root for the "mbm" partition.
2009-06-18 15:07:14 -07:00
Doug Zongker
d683785ec9 resolved conflicts for merge of fb2e3af3 to master 2009-06-17 22:07:13 -07:00
Doug Zongker
fb2e3af3f9 let the "firmware" command take the file straight from the package
To do a firmware-install-on-reboot, the update binary tells recovery
what file to install before rebooting.  Let this file be specified as
"PACKAGE:<foo>" to indicate taking the file out of the OTA package,
avoiding an extra copy to /tmp.  Bump the API version number to
reflect this change.
2009-06-17 18:12:16 -07:00
Doug Zongker
ddd6a2865d split out device-specific recovery UI code into vendor directories
Take some device-specific details of the recovery UI (eg, what keys to
press to bring up the interface and perform actions, exact text of the
menu, etc.) and split them out into separate C functions.  Arrange to
take implementations of those functions from the appropriate vendor
directory at build time.  Provide a default implementation in case no
vendor-specific one is available.
2009-06-11 14:50:33 -07:00
Doug Zongker
f28c916e73 remove unused permissions scheme from amend
Amend (aka the recovery command language) had a half-implemented
scheme of limiting which commands OTA packages were allowed to
execute.  It's not clear what this was ever supposed to be good for.
Remove it.
2009-06-02 15:41:00 -07:00
Doug Zongker
07e1dca706 don't say "install complete" when it really isn't
Change the recovery UI so that when there is a hboot or radio update
pending (which the user most do a home+back reboot to actually
install), the UI tells them so, instead of saying "Install from sdcard
complete."
2009-05-28 19:02:45 -07:00
Doug Zongker
1066d2c319 AI 144070: Add an option to wipe cache (only) to the recovery menu.
Automated import of CL 144070
2009-04-01 13:57:40 -07:00
The Android Open Source Project
c24a8e688a auto import from //depot/cupcake/@135843 2009-03-03 19:28:42 -08:00
The Android Open Source Project
ffb48f64fe auto import from //depot/cupcake/@135843 2009-03-03 18:28:14 -08:00
The Android Open Source Project
8b7334b3c2 auto import from //branches/cupcake/...@130745 2009-02-10 15:43:56 -08:00
The Android Open Source Project
928d471ef2 auto import from //branches/cupcake/...@125939 2009-01-09 17:50:54 -08:00
The Android Open Source Project
23580ca27a Initial Contribution 2008-10-21 07:00:00 -07:00