Commit graph

1009 commits

Author SHA1 Message Date
Doug Zongker
2efc9d994c clear BCB in misc partition before rebooting
Something is leaving behind wipe commands in the BCB area of the /misc
partition.  We don't know what is doing that.  It should always be
safe to zero out that area from uncrypt, though (because if uncrypt is
running then it's got the command we want in the recovery command file
rather than the BCB).

Bug: 16715412
Change-Id: Iad01124287f13b80ff71d6371db6371f43c43211
2014-08-18 15:55:28 -07:00
Doug Zongker
1a35a58690 revert uncrypt back to dynamic linking, fix libs
Bug: 17029174, 17015157
Change-Id: I1d24f3402875dfb972daa6daef0f385baeff84e9
2014-08-14 10:32:46 -07:00
Doug Zongker
537d34f907 change uncrypt to static linking
Bug: 17015157
Change-Id: I3c4bdcf4f11d44b617bb731a48413e3707044d1c
2014-08-14 08:01:17 -07:00
Andres Morales
9dc71cfa52 Merge "Erase PST partition if its marked to be erased." into lmp-dev 2014-08-05 00:34:22 +00:00
Andres Morales
ee19387905 Erase PST partition if its marked to be erased.
We need to wipe the challenges on this partition
if OEM unlock is enabled, as this is a signal that
the user has opted out of factory reset protection.

go/factory-reset

Bug: 16633064
Change-Id: Icb8f1433bf99ca57813f5b72d5a3dd15fa94a263
2014-08-06 09:58:55 -07:00
Doug Zongker
2b5f0e0f76 remove spurious parens from error message
These error messages include empty parens after each string
substition.  Ill-advised cut and paste, probably.

Bug: 16467401
Change-Id: Ib623172d6228354afdcc2e33442cc53a07f0ecbc
2014-08-06 08:25:03 -07:00
JP Abgrall
78d458c3d2 Fix length printing + formats
Fix wrong argument order.
Fix for 32 vs 64 bit.

(reported by htc)

Change-Id: Ie37a280bed2848199bcc075500e1326e371cd326
2014-08-04 16:44:33 -07:00
Doug Zongker
eaf33654c1 only do uncryption on packages in /data
If recovery is invoked with a package somewhere other than /data,
leave it alone.

Change-Id: Ief358b53df467ae24a65e30e7a631da59bf13683
2014-07-31 15:42:13 -07:00
Michael Runge
a91ecc59b2 Auto create parent directories for rename support
Sometimes renames will move a file into a directory
that does not yet exist.  This will create the
parent directories, using the same symlink logic,
to ensure that there is a valid destination.

Change-Id: Iaa005a12ce800c39f4db20f7c25a2a68cb40a52d
2014-07-21 17:40:02 -07:00
Doug Zongker
945fc68c62 do sdcard sideloading through the fuse filesystem
Make a fuse filesystem that sits on top of the selected package file
on the sdcard, so we can verify that the file contents don't change
while being read and avoid copying the file to /tmp (that is, RAM)
before verifying and installing it.

Change-Id: Ifd982aa68bfe469eda5f839042648654bf7386a1
2014-07-10 10:58:35 -07:00
Doug Zongker
18a78e0a16 refactor fuse sideloading code
Split the adb-specific portions (fetching a block from the adb host
and closing the connections) out from the rest of the FUSE filesystem
code, so that we can reuse the fuse stuff for installing off sdcards
as well.

Change-Id: I0ba385fd35999c5f5cad27842bc82024a264dd14
2014-07-10 10:55:07 -07:00
Doug Zongker
93950229cf drop APPLY_CACHE and refactor APPLY_EXT
Drop support for sideloading OTA packages of the cache partition (a
half-solution that's long since been deprecated by "adb sideload").
Refactor the code to sideload OTA packages from SD cards: remove the
installation code from the file browser.

Change-Id: Id0dff6b27c4a5837546f174f50e2e1d0379c43db
2014-07-08 14:10:23 -07:00
Doug Zongker
075ad800c5 sideload without holding the whole package in RAM
Implement a new method of sideloading over ADB that does not require
the entire package to be held in RAM (useful for low-RAM devices and
devices using block OTA where we'd rather have more RAM available for
binary patching).

We communicate with the host using a new adb service called
"sideload-host", which makes the host act as a server, sending us
different parts of the package file on request.

We create a FUSE filesystem that creates a virtual file
"/sideload/package.zip" that is backed by the ADB connection -- users
see a normal file, but when they read from the file we're actually
fetching the data from the adb host.  This file is then passed to the
verification and installation systems like any other.

To prevent a malicious adb host implementation from serving different
data to the verification and installation phases of sideloading, the
FUSE filesystem verifies that the contents of the file don't change
between reads -- every time we fetch a block from the host we compare
its hash to the previous hash for that block (if it was read before)
and cause the read to fail if it changes.

One necessary change is that the minadbd started by recovery in
sideload mode no longer drops its root privileges (they're needed to
mount the FUSE filesystem).  We rely on SELinux enforcement to
restrict the set of things that can be accessed.

Change-Id: Ida7dbd3b04c1d4e27a2779d88c1da0c7c81fb114
2014-07-02 12:16:36 -07:00
Riley Andrews
e8d7dd4ed1 am 3e0fc39e: am 974fe112: Merge "Fix recovery mode."
* commit '3e0fc39ec27c0ed96ffd2a617f1841fe3bf3c8f6':
  Fix recovery mode.
2014-06-25 00:44:02 +00:00
Riley Andrews
3e0fc39ec2 am 974fe112: Merge "Fix recovery mode."
* commit '974fe112ae6df95ca6d49688d6e3e459d87e16de':
  Fix recovery mode.
2014-06-25 00:40:46 +00:00
Colin Cross
22bcf97a59 recovery: enable panic_on_oops
Set panic_on_oops=1 to reboot if the kernel panics.

Change-Id: Id9e8689a570229db2ea2a3d72b52784f8a1ed107
2014-06-24 13:43:39 -07:00
Riley Andrews
974fe112ae Merge "Fix recovery mode." 2014-06-24 18:00:13 +00:00
Riley Andrews
e739d7e6cd Fix recovery mode.
Duplicate changes made to init.rc for https://android-review.googlesource.com/98852
in the init.rc used for recovery mode.

Bug 15849856

Change-Id: Ia376ddf6373a28718653f7fb1435bf7ecb33d813
2014-06-24 17:11:10 -07:00
Ji-Hwan Lee
b9afc2bf15 Use LOCAL_REQUIRED_MODULES for mkfs.f2fs
Instead of LOCAL_ADDITIONAL_DEPENDENCIES.

Bug: 15702524
Change-Id: Ic152ae60354bf09eccdb9a85dcd04f0f076a6422
2014-06-18 17:30:14 +00:00
JP Abgrall
37aedb3faf Support F2FS for the data partition
This adds F2FS support
- for wiping a device
- for the install "format" command.

Note: crypto data in "footer" with a default/negative length
is not supported, unlike with "ext4".

Change-Id: I8d141a0d4d14df9fe84d3b131484e9696fcd8870
Signed-off-by: JP Abgrall <jpa@google.com>
2014-06-16 19:07:39 -07:00
Joey Pan
ba545d7e23 minui: avoid random screen frame at startup
Clear framebuffer at init.

[toddpoynor@google.com: forward port]
Change-Id: Ie98c7724cd974dcacef3e3559a6fe492864a5e72
2014-06-12 11:06:52 -07:00
Doug Zongker
43772d26a5 advance progress bar during block OTA installations
While executing syspatch and package_extract_file() calls with don't
care maps (both of which are used to rewrite the system image in
incremental and full block OTAs, respectively), pass a progress
callback in and use it to update the visible progress bar.

Change-Id: I1d3742d167c1bb2130571eb5103b7795c65ff371
2014-06-09 14:15:22 -07:00
Doug Zongker
3fa26c9fa2 am dff8afe1: (-s ours) restore holo UI in recovery -- DO NOT MERGE
* commit 'dff8afe1b21c6ffe09269434f9f8f0d166e1a848':
  restore holo UI in recovery -- DO NOT MERGE
2014-06-06 16:27:57 +00:00
Doug Zongker
9a5f58427a Merge "restore holo UI in recovery" 2014-06-06 16:03:04 +00:00
Doug Zongker
5b5f6c2fd3 restore holo UI in recovery
Return to the recovery to the holo appearance.

Bug: 15424396
Change-Id: Id4d3f23e0a6251a12aa42f3793cff347f38b4243
2014-06-06 09:01:57 -07:00
Doug Zongker
ad07492046 am 54a61179: am cfd4b286: Merge "recovery: initialize keys press tracking status"
* commit '54a6117935fe7470d23f7a538aeec9d6b139791b':
  recovery: initialize keys press tracking status
2014-06-06 16:00:20 +00:00
Doug Zongker
54a6117935 am cfd4b286: Merge "recovery: initialize keys press tracking status"
* commit 'cfd4b2864534f062a01730d81b2cd7e054087e8f':
  recovery: initialize keys press tracking status
2014-06-06 15:55:57 +00:00
Doug Zongker
cfd4b28645 Merge "recovery: initialize keys press tracking status" 2014-06-06 15:33:16 +00:00
Mihai Serban
187d626e61 recovery: initialize keys press tracking status
Checks for keys pressed return random results because of an uninitialized data
structure.

Change-Id: Ic8b3d453d62347921aa893403079b374c16a092e
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
2014-06-06 15:23:20 +03:00
Doug Zongker
dff8afe1b2 restore holo UI in recovery -- DO NOT MERGE
Since we don't have quantum assets for recovery yet, go back to the
holo appearance (dark background, blue glowing progress bar) for
lmp-preview.

Change-Id: Id4d3f23e0a6251a12aa42f3793cff347f38b4243
2014-06-03 11:02:31 -07:00
Doug Zongker
c704e06ce5 disable async reboot during package installation
The default recovery UI will reboot the device when the power key is
pressed 7 times in a row, regardless of what recovery is doing.
Disable this feature during package installation, to minimize the
chance of corrupting the device due to a mid-install reboot.  (Debug
packages can explicitly request that the feature be reenabled.)

Change-Id: I20f3ec240ecd344615d452005ff26d8dd7775acf
2014-05-23 08:52:31 -07:00
Doug Zongker
ffb557d351 am 502e4595: am d1c64060: am 5fbb729f: Merge "exit instead of return if sideload file creation fails"
* commit '502e45957420484eec2367e7580e9bec96605c5d':
  exit instead of return if sideload file creation fails
2014-05-16 17:49:39 +00:00
Doug Zongker
502e459574 am d1c64060: am 5fbb729f: Merge "exit instead of return if sideload file creation fails"
* commit 'd1c64060abf8a56a259c0913244448fdba245f6c':
  exit instead of return if sideload file creation fails
2014-05-16 17:48:04 +00:00
Doug Zongker
d1c64060ab am 5fbb729f: Merge "exit instead of return if sideload file creation fails"
* commit '5fbb729f3eb67c9bb59580f692a31e5c50e24e6d':
  exit instead of return if sideload file creation fails
2014-05-16 17:45:18 +00:00
Doug Zongker
5fbb729f3e Merge "exit instead of return if sideload file creation fails" 2014-05-16 17:42:12 +00:00
Doug Zongker
ddb1b74498 am c4804e9b: am d4592694: am 3ca99f6c: Merge "fix vulnerability in bspatch"
* commit 'c4804e9b9c143652d17441b4b672b920b11cc94a':
  fix vulnerability in bspatch
2014-05-16 15:09:35 +00:00
Doug Zongker
c4804e9b9c am d4592694: am 3ca99f6c: Merge "fix vulnerability in bspatch"
* commit 'd4592694b41d5f8309d98cd3312b5486216cc685':
  fix vulnerability in bspatch
2014-05-16 15:06:23 +00:00
Doug Zongker
d4592694b4 am 3ca99f6c: Merge "fix vulnerability in bspatch"
* commit '3ca99f6cb8ffbe19c7ef5409f3dac18ea0c254bd':
  fix vulnerability in bspatch
2014-05-16 15:03:24 +00:00
Doug Zongker
3ca99f6cb8 Merge "fix vulnerability in bspatch" 2014-05-16 14:58:33 +00:00
Doug Zongker
eed6483638 am 0766cdf4: am d2fb4ed5: am d27aa76a: Merge "Support BGRA framebuffer"
* commit '0766cdf49acb77677864995e931eec391243505d':
  Support BGRA framebuffer
2014-05-13 22:24:06 +00:00
Doug Zongker
0766cdf49a am d2fb4ed5: am d27aa76a: Merge "Support BGRA framebuffer"
* commit 'd2fb4ed58997afd18bd2b5274bf1835644d454fb':
  Support BGRA framebuffer
2014-05-13 22:19:37 +00:00
Doug Zongker
d2fb4ed589 am d27aa76a: Merge "Support BGRA framebuffer"
* commit 'd27aa76a6ff6436cfb8340bf3d04aba186cc4de1':
  Support BGRA framebuffer
2014-05-13 22:15:14 +00:00
Doug Zongker
d27aa76a6f Merge "Support BGRA framebuffer" 2014-05-13 22:09:40 +00:00
Daniel Leung
f766396d99 Support BGRA framebuffer
The re-designed recovery graphics code only supports RGB{_,X,A}
framebuffer, and this patch adds support for BGRA framebuffer.

Change-Id: I3780c8288088f497fa248f3492c54f43834a8598
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com>
Reviewed-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com>
Tested-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com>
Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
2014-05-13 15:00:40 -07:00
Doug Zongker
8c7457a2c5 am 48abd574: am 34ff5fe3: am 74b90b30: Merge "screen_ui: Initialize text buffer"
* commit '48abd574cb1b7b0adbe1de36224fb974182aaa2d':
  screen_ui: Initialize text buffer
2014-05-13 17:38:15 +00:00
Doug Zongker
48abd574cb am 34ff5fe3: am 74b90b30: Merge "screen_ui: Initialize text buffer"
* commit '34ff5fe3f59abfb1984189ade32059cc47bf97e5':
  screen_ui: Initialize text buffer
2014-05-13 17:31:51 +00:00
Doug Zongker
34ff5fe3f5 am 74b90b30: Merge "screen_ui: Initialize text buffer"
* commit '74b90b309f67dc3b8bb74e47c4eddf7ce511bc35':
  screen_ui: Initialize text buffer
2014-05-13 17:28:54 +00:00
Doug Zongker
74b90b309f Merge "screen_ui: Initialize text buffer" 2014-05-13 17:25:52 +00:00
Doug Zongker
4aa12dd0de fix vulnerability in bspatch
Patches with control data tuples with negative numbers in the first
and/or second can cause bspatch to write to arbitrary locations in the
heap.

Change-Id: I8c5d81948be773e6483241131d3d166b6da27cb8
2014-05-13 08:40:49 -07:00
Michael Runge
f5d9f89152 Allow 0-byte files in full OTAs.
Currently, the writeProcessFunction fails when
there are zero bytes to write, potentially returning
errno from a previous operation, or hanging
indefinitely while it waits for a >0 result on a
write of size 0.  This happens when the output
file is intended to be zero bytes in size.

Change-Id: Ib3cfcaf66d82942bc89e5f5c64697862403b38da
2014-05-09 18:09:28 +00:00