Commit Graph

2984 Commits

Author SHA1 Message Date
Doug Zongker c6ab95e9d1 recovery: write partitions more conservatively
Write and verify partitions using write(2) and read(2) rather than the
stdio functions.  Read and write in 4kb blocks.  When writing, fsync()
every 1MB.

Bug: 9602014
Change-Id: Ie98ce38e857786fc0f4ebf36bb5ffc93b41bc96f
2013-07-09 16:31:07 -07:00
Doug Zongker 35c474e8c0 recovery: try to write EMMC partitions more reliably
Nexus 4 has flash errors that manifest during large writes (eg, of the
radio partition).  Writes of some blocks seem to be dropped silently,
without any errors being returned to the user level.

Make two changes to the partition-writing code:

- break it up into 1MB writes instead of writing partitions with a
  single fwrite() call.  Pause for 50ms in between every chunk.

- read the partition back after writing and verify that we read what
  we wrote.  Drop caches before reading so we (hopefully) are reading
  off the actual flash and not some cache.

Neither of these should be necessary.

Bug: 9602014

Change-Id: Ice2e24dd4c11f1a57968277b5eb1468c772f6f63
2013-07-09 16:30:22 -07:00
Doug Zongker a4ee1f8b76 Merge "recovery: preserve recovery logs across cache wipes" 2013-07-09 21:16:53 +00:00
Doug Zongker 6d0d7ac051 recovery: preserve recovery logs across cache wipes
When doing a cache wipe or a factory reset (which includes a cache
wipe), save any last* log files in the /cache/recovery directory and
write them back after reformatting the partition, so that wiping data
doesn't lose useful log information.

Change-Id: I1f52ae9131760b5e752e136645c19f71b7b166ee
2013-07-09 13:34:55 -07:00
Doug Zongker fafc85b4ad recovery: move log output to stdout
Recovery currently has a random mix of messages printed to stdout and
messages printed to stderr, which can make logs hard to read.  Move
everything to stdout.

Change-Id: Ie33bd4a9e1272e731302569cdec918e0534c48a6
2013-07-09 12:50:24 -07:00
Doug Zongker 2148133d46 am c870a99c: recovery: write partitions more conservatively
* commit 'c870a99c4aeb9e232ee68951e666b5fa670d1680':
  recovery: write partitions more conservatively
2013-07-09 11:02:07 -07:00
Doug Zongker c870a99c4a recovery: write partitions more conservatively
Write and verify partitions using write(2) and read(2) rather than the
stdio functions.  Read and write in 4kb blocks.  When writing, fsync()
every 1MB.

Bug: 9602014
Change-Id: Ie98ce38e857786fc0f4ebf36bb5ffc93b41bc96f
2013-07-09 10:42:15 -07:00
Doug Zongker 602c4ebd39 am 0ccaccf7: am 044a0b4d: recovery: try to write EMMC partitions more reliably
* commit '0ccaccf7d0f50bb9555ee13a841c246a1fea80f2':
  recovery: try to write EMMC partitions more reliably
2013-07-08 14:14:24 -07:00
yetta_wu 573e830b27 am 4d4b233e: am 2f6877a0: recovery: init backgroundIcon properly to avoid recovery mode crash
* commit '4d4b233eae51d5580b58cb00d3aa45ecbb1b255e':
  recovery: init backgroundIcon properly to avoid recovery mode crash
2013-07-08 14:14:24 -07:00
Doug Zongker 0ccaccf7d0 am 044a0b4d: recovery: try to write EMMC partitions more reliably
* commit '044a0b4d49a11edfa13471ce20914b0514eb7e0e':
  recovery: try to write EMMC partitions more reliably
2013-07-08 14:09:59 -07:00
Doug Zongker 044a0b4d49 recovery: try to write EMMC partitions more reliably
Nexus 4 has flash errors that manifest during large writes (eg, of the
radio partition).  Writes of some blocks seem to be dropped silently,
without any errors being returned to the user level.

Make two changes to the partition-writing code:

- break it up into 1MB writes instead of writing partitions with a
  single fwrite() call.  Pause for 50ms in between every chunk.

- read the partition back after writing and verify that we read what
  we wrote.  Drop caches before reading so we (hopefully) are reading
  off the actual flash and not some cache.

Neither of these should be necessary.

Bug: 9602014

Change-Id: Ice2e24dd4c11f1a57968277b5eb1468c772f6f63
2013-07-08 12:59:22 -07:00
yetta_wu 5b468fc930 recovery: init backgroundIcon properly to avoid recovery mode crash
We met factory issue that some devices would crash in recovery mode
because the backgroundIcon array did not reset to NULL when initializing.

Bug: 9568624
Change-Id: I13c7a7cc1053a7ffdbadd71740c1a2b4a2af6bba
Signed-off-by: yetta_wu <yetta_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-07-02 12:35:58 -07:00
Doug Zongker f24fd7e847 recovery: copy logs to cache more aggressively
Copy logs to /cache immediately upon a package installation failure;
don't wait for recovery to finish.  (If the user reboots without
exiting recovery the "right" way, the logs never get copied at all.)

Change-Id: Iee342944e7ded63da5a4af33d11ebc876f6c0835
2013-07-02 11:43:25 -07:00
yetta_wu 4d4b233eae am 2f6877a0: recovery: init backgroundIcon properly to avoid recovery mode crash
* commit '2f6877a0220475303907203308c018d789ea1a53':
  recovery: init backgroundIcon properly to avoid recovery mode crash
2013-06-25 12:56:12 -07:00
yetta_wu 2f6877a022 recovery: init backgroundIcon properly to avoid recovery mode crash
We met factory issue that some devices would crash in recovery mode
because the backgroundIcon array did not reset to NULL when initializing.

Bug: 9568624
Change-Id: I13c7a7cc1053a7ffdbadd71740c1a2b4a2af6bba
Signed-off-by: yetta_wu <yetta_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-06-25 12:50:20 -07:00
Todd Poynor 2f2c98869b start healthd in recovery
Change-Id: I16e3e0ddb8ca062431deb4be83c5be5eb786d76f
2013-06-18 17:51:13 -07:00
Doug Zongker 7839f64baf am 8cd12112: am d51bfc9b: Merge "Fix the potential segmentation fault"
* commit '8cd12112e444e01163526fe6ab237f6164b0018b':
  Fix the potential segmentation fault
2013-06-04 12:17:42 -07:00
Doug Zongker 8cd12112e4 am d51bfc9b: Merge "Fix the potential segmentation fault"
* commit 'd51bfc9b1fe89321af3c629e7b23a747050332e1':
  Fix the potential segmentation fault
2013-06-04 12:10:28 -07:00
Doug Zongker d51bfc9b1f Merge "Fix the potential segmentation fault" 2013-06-04 19:05:59 +00:00
Jin Feng 93ffa7579c Fix the potential segmentation fault
Extral newline can trigger recovery segmentation fault
Test case:
host$ adb shell 'echo -en "--update_package=ota_update.zip\n--show_text\n\n" > /cache/recovery/command'
host$ adb reboot recovery

Change-Id: If1781c1f5ad94a273f1cb122b67cedd9fb562433
Signed-off-by: Jin Feng <jin88.feng@gmail.com>
2013-06-04 17:46:24 +08:00
Doug Zongker 22bdc370b0 am da1ebaef: recovery: save logs from the last few invocations of recovery
* commit 'da1ebaef0aa8e38db6edf8bfc3d96290461a424f':
  recovery: save logs from the last few invocations of recovery
2013-05-21 11:31:09 -07:00
Doug Zongker 4e021c56f3 am 7c3ae45e: recovery: turn on text display for install errors in debug builds
* commit '7c3ae45ef9306d2ff4b491e0488c8849bf15ce90':
  recovery: turn on text display for install errors in debug builds
2013-05-21 11:31:09 -07:00
Doug Zongker da1ebaef0a recovery: save logs from the last few invocations of recovery
Extends the last_log mechanism to save logs from the last six
invocations of recovery, so that we're more likely to have useful logs
even if the device has repeatedly booted into recovery.

Change-Id: I08ae7a09553ada45f9e0733fe1e55e5a22efd9f9
2013-05-21 11:19:15 -07:00
Doug Zongker 7c3ae45ef9 recovery: turn on text display for install errors in debug builds
Hopefully this will reduce the number of OTA "bugs" reported that are
really just someone having changed their system partition,
invalidating future incremental OTAs.

Also fixes a longstanding TODO about putting LOGE() output in the
on-screen display.

Change-Id: I44e5be65b2dee7ebce2cce28ccd920dc3d6e522e
2013-05-21 11:18:38 -07:00
Doug Zongker 46bee63afc recovery: save logs from the last few invocations of recovery
Extends the last_log mechanism to save logs from the last six
invocations of recovery, so that we're more likely to have useful logs
even if the device has repeatedly booted into recovery.

Change-Id: I08ae7a09553ada45f9e0733fe1e55e5a22efd9f9
2013-05-16 11:25:28 -07:00
Doug Zongker 596b342a04 recovery: turn on text display for install errors in debug builds
Hopefully this will reduce the number of OTA "bugs" reported that are
really just someone having changed their system partition,
invalidating future incremental OTAs.

Also fixes a longstanding TODO about putting LOGE() output in the
on-screen display.

Change-Id: I44e5be65b2dee7ebce2cce28ccd920dc3d6e522e
2013-05-16 10:47:02 -07:00
Doug Zongker c7a6858dc9 Merge "verifier: update to support certificates using SHA-256" 2013-04-11 22:02:46 +00:00
Doug Zongker bac7fba027 verifier: update to support certificates using SHA-256
Change-Id: Ifd5a29d459acf101311fa1c220f728c3d0ac2e4e
2013-04-10 11:32:17 -07:00
Ying Wang e5d37b409f am 4e21482d: Add liblog
* commit '4e21482d979f6f81b34f92e664adf137555d4504':
  Add liblog
2013-04-09 22:21:14 -07:00
Ying Wang 4e21482d97 Add liblog
Bug: 8580410
Change-Id: Ie60dade81c06589cb0daee431611ded34adef8e6
2013-04-09 21:41:29 -07:00
Jean-Baptiste Queru 84a6c0d298 am b5bd4fb7: (-s ours) am 2f50df00: am c09444eb: am f91bd41c: am 1c302caf: (-s ours) am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'b5bd4fb79544b1939e9f977a88a707bdc90cf66c':
2013-03-11 20:05:35 +00:00
Jean-Baptiste Queru b5bd4fb795 am 2f50df00: am c09444eb: am f91bd41c: am 1c302caf: (-s ours) am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '2f50df0058dff23fbdfc6b123bb92aaa90aea09b':
2013-03-11 12:58:20 -07:00
Jean-Baptiste Queru 2f50df0058 am c09444eb: am f91bd41c: am 1c302caf: (-s ours) am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'c09444eb5b66a5702db99d9b7de23cb73bf11aa4':
2013-03-11 12:41:56 -07:00
Jean-Baptiste Queru c09444eb5b am f91bd41c: am 1c302caf: (-s ours) am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'f91bd41c46ec8bd085c361ea0bdf53efe13c87ca':
2013-03-11 12:31:59 -07:00
Jean-Baptiste Queru f91bd41c46 am 1c302caf: (-s ours) am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '1c302cafdd793ae250f767b88da718b916751feb':
2013-03-11 12:22:41 -07:00
Jean-Baptiste Queru 1c302cafdd am c14a7fbd: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'c14a7fbd895aed1ce34c0682ece5ef361f21dd1c':
2013-03-11 12:19:04 -07:00
Jean-Baptiste Queru c14a7fbd89 Reconcile with jb-mr1-release - do not merge 2013-03-11 12:15:19 -07:00
Doug Zongker 6fd59ac07d more font improvements and cleanup
Get rid of the notion of a font's "ascent"; the reference point for
drawing is the top-left corner of the character box rather than the
baseline.  Add some more space between the menu entries and make the
highlight bar around the text.

Replace the default font.png with two images; the build system will
include one or the other based on the resolutions of the device.

Restore the original compiled-in bitmap font, to fall back on when
font.png can't be found (eg, in the charger binary).

Add support for bold text (when a font.png image is used).

Change-Id: I6d211a486a3636f20208502b1cd2aeae8b9f5b02
2013-03-07 13:34:24 -08:00
Doug Zongker 55a36ac1e0 recovery: change font for menus to be an image
Instead of representing the font used for menus and log messages in
the recovery binary, load it from a resource PNG image.  This allows
different devices to substitute their own font images.

Change-Id: Ib36b86db3d01298aa7ae2b62a26ca29e6ef18014
2013-03-04 16:37:44 -08:00
Nick Kralevich 869abf03e2 am ec838b88: Merge "minadbd: remove unnecessary header files."
* commit 'ec838b885dd8b74b8682dd2498c7da8f7afca291':
  minadbd: remove unnecessary header files.
2013-03-01 17:38:34 +00:00
Nick Kralevich ec838b885d Merge "minadbd: remove unnecessary header files." 2013-03-01 17:21:16 +00:00
Nick Kralevich 05aa743493 minadbd: remove unnecessary header files.
Change-Id: Iff2b53d9e63b279d0262cd2e9cfb11e0ca4d6b42
2013-03-01 09:16:26 -08:00
Ben Murdoch e729bac228 Add a CleanSpec for bootable/recovery
Change-Id: Ifa7a3aa5e2e3fd5d13266115d592bbfd0aa309c5
2013-02-22 11:29:02 +00:00
Ken Sumrall f35d1cef7c Move to using the new unified fstab in recovery.
Instead of reading it's own fstab, have recovery invoke
fs_mgr to read the unified fstab.

Change-Id: I80c75d2c53b809ac60a4a69f0ef7ebfa707c39e9
2013-02-19 17:37:22 -08:00
Ethan Yonker f087dfb52c exit instead of return if sideload file creation fails
A return here leaves adb sideload in a permanent loop. An exit is
more appropriate for this error.

Change-Id: I80fb8abae4f6378833aa75f9eaf7ec1acd44b274
Signed-off-by: Ethan Yonker <ethanayonker@gmail.com>
2013-01-09 16:35:51 +00:00
Doug Zongker 133f56bde0 am f7d42340: am c560a67b: add optional overscan compensation to recovery graphics
* commit 'f7d423403d0aed6b8488559185e2246257abc58b':
  add optional overscan compensation to recovery graphics
2013-01-02 16:35:06 -08:00
Doug Zongker f7d423403d am c560a67b: add optional overscan compensation to recovery graphics
* commit 'c560a67b12350102ba237fa70cedc7c972ad4e4b':
  add optional overscan compensation to recovery graphics
2013-01-02 15:45:53 -08:00
Doug Zongker c560a67b12 add optional overscan compensation to recovery graphics
If your screen is a TV, it may not actually be displaying the edges of
the framebuffer.  Allow specifying an overscan percentage, and move
each edge of the framebuffer in by that percent of the width/height.
(The gr_* layer just lies to the caller about the size of the
framebuffer, telling the caller it's smaller than it really is, and
offsets all drawing commands to match.)

Change-Id: I11bb2feb39ae522bd3e957a14ebdecf3609e0fdc
2012-12-18 16:31:27 -08:00
Doug Zongker 2ad5d91b1c am 6a1d21a0: am bb01d0c1: add NextCheckKeyIsLong() and EnqueueKey() methods
* commit '6a1d21a0ceb1fb46e9113f3d2a81390612806dfd':
  add NextCheckKeyIsLong() and EnqueueKey() methods
2012-12-18 09:14:06 -08:00
Doug Zongker 6a1d21a0ce am bb01d0c1: add NextCheckKeyIsLong() and EnqueueKey() methods
* commit 'bb01d0c12b29e6ff4a9169c21c95408e7eb882c5':
  add NextCheckKeyIsLong() and EnqueueKey() methods
2012-12-18 09:11:47 -08:00