Commit graph

891 commits

Author SHA1 Message Date
Adam Langley
6ed899a9b6 Remove superfluous OpenSSL include paths.
This include path was needed because system/vold/cryptfs.h included an
OpenSSL header just to get the length of a SHA-256 hash. This has been
fixed in https://android-review.googlesource.com/#/c/124477/1.

Change-Id: I06a8ba0ee5b9efcc3260598f07d9819f065711de
2015-01-22 16:47:36 -08:00
Yabin Cui
dd719dfe4e Merge "Use getmntent when accessing /proc/mounts." 2015-01-06 04:24:58 +00:00
Dan Albert
a5d63956c4 Merge "Remove an uninitialized value." 2015-01-05 21:40:11 +00:00
Yabin Cui
a382e2bdb2 Use getmntent when accessing /proc/mounts.
Bug: 18887435
Change-Id: Ice44c14fc8ee79eab259caf486e123b6af21ceb0
2015-01-02 14:00:13 -08:00
Elliott Hughes
538d7d838d Merge "Fix missing #includes in bootable/recovery." 2014-12-29 21:17:56 +00:00
Elliott Hughes
d4d4c2456a Fix missing #includes in bootable/recovery.
Change-Id: I58dfbac6ca1aa80d3659f53a8fad1bbbbdc9b941
2014-12-29 12:46:43 -08:00
Dan Albert
7279f97ab4 Remove an uninitialized value.
The assignment of this value was removed in 0d32f25, but the
declaration was still there and still tested. Clang issues a warning
for this.

Change-Id: I748bfb8b4f78ceed1c1b5b1bb80cb4e873e4facc
2014-12-18 22:50:08 +00:00
Ying Wang
c43b17f0ad Merge "Fix recovery image build for 32p" 2014-12-01 23:59:21 +00:00
Bruce Beare
4c3c7a962f Fix recovery image build for 32p
When building for 32p, we need to be explicit that we wish to build
the 32bit version of the binaries that will be placed in the recovery
image. The recovery image doesn't actually care... but if we are not
explicit in this, the makefiles will ask for the 64bit binaries but the
Android.mk for the binaries will supply the 32bit images (causing the
build to fail).

Change-Id: Iea2d5f412740c082795da4358765751138a4b167
2014-11-30 19:21:19 -08:00
Dan Albert
d34b63780e Merge "Global C++11 compatibility." 2014-11-20 21:21:14 +00:00
Dan Albert
32f9fe7fab Global C++11 compatibility.
Our build system compiles flex/bison as C++ rather than C, but a few
projects add `-x c` to their flags, forcing the compiler to compile
them as C. This causes the compiler to reject the global C++ standard
flag, so we need to explicitly provide a C standard flag to override
it.

Bug: 18466763
Change-Id: Id68ad9317261ed4d857a949b07288bd137ff6303
2014-11-20 13:17:35 -08:00
Yabin Cui
92242c7048 Merge "kill HAVE_FORKEXEC" 2014-11-13 18:14:54 +00:00
Yabin Cui
678f7d4a36 kill HAVE_FORKEXEC
Bug: 18317407
Change-Id: Idd4e0effa96752e2c0ca959728f80df4d2d34187
2014-11-12 16:51:45 -08:00
Dan Albert
c7249660f9 am 4f66469b: Merge "More test makefile cleanup."
* commit '4f66469b29a34811b69518a266be31fe42cc111b':
  More test makefile cleanup.
2014-10-17 07:47:57 +00:00
Dan Albert
4f66469b29 Merge "More test makefile cleanup." 2014-10-17 01:28:35 +00:00
Dan Albert
13f21c2bc7 More test makefile cleanup.
Global variables kill.
No need to manually link gtest, and that causes problems with
libc++.

Change-Id: If804cdd436cf1addfa9a777708efbc37c27770b6
2014-10-17 01:05:08 +00:00
Dan Albert
ea5828a24f am 28ffde5e: Merge "Revert "Copy epoll(2) changes to minadb.""
* commit '28ffde5ebd33d5b693906a93087e6eea627cd8d0':
  Revert "Copy epoll(2) changes to minadb."
2014-09-26 16:12:23 +00:00
Dan Albert
28ffde5ebd Merge "Revert "Copy epoll(2) changes to minadb."" 2014-09-26 16:04:16 +00:00
Dan Albert
f420f8eb63 Revert "Copy epoll(2) changes to minadb."
This reverts commit db8c959049.
2014-09-25 15:12:19 -07:00
Jeff Sharkey
e95ed95f05 am a6e13ae0: Include reason when wiping data.
* commit 'a6e13ae01bff5109361868f565187f16d045c82d':
  Include reason when wiping data.
2014-09-24 23:35:38 +00:00
Jeff Sharkey
a6e13ae01b Include reason when wiping data.
This will help us track down who requested a data wipe.

Bug: 17412160
Change-Id: I1c439fbd29f96b9851810baca9101f683a0f18d8
2014-09-24 11:46:17 -07:00
Elliott Hughes
78a3027860 am 530b61e0: Merge "Copy epoll(2) changes to minadb."
* commit '530b61e0b5f154e5f38853c10a28e0ea6f41c2ca':
  Copy epoll(2) changes to minadb.
2014-09-23 18:57:39 +00:00
Elliott Hughes
530b61e0b5 Merge "Copy epoll(2) changes to minadb." 2014-09-23 18:36:34 +00:00
Elliott Hughes
db8c959049 Copy epoll(2) changes to minadb.
Bug: 17588403
Change-Id: Ib3525824ff09330bd9d6f9e96d662e5a55a20ec2
2014-09-23 10:50:55 -07:00
Doug Zongker
574443d895 create block map for all update packages on /data
Always create the block map for packages on /data; don't only look at
the encryptable/encrypted flags.

Bug: 17395453
Change-Id: Iaa7643a32898328277841e324305b9419a9e071c
2014-09-05 08:22:12 -07:00
Doug Zongker
40482ea2ae Merge "fix comment in blockimg updater code" into lmp-dev 2014-09-04 15:26:29 +00:00
Doug Zongker
f7bb09dae8 fix comment in blockimg updater code
The comment for the DEBUG_ERASE setting is exactly backwards.

Change-Id: I98ab5828365894217fc78976817a131e7d22d5c1
2014-09-04 08:10:32 -07:00
Andrew Boie
8328922ff0 use lseek64 instead of lseek
Otherwise, overflow problems can occur with images larger than
2G since the offsets will overflow a 32-bit off_t.

Change-Id: I05951a38ebeae83ad2cb938594e8d8adb323e2aa
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2014-09-04 07:54:17 -07:00
Doug Zongker
5f875bf577 remove code for original block OTA mechanism
Superseded by newer code.

Bug: 16984795
Change-Id: I842299f6a02af7ccf51ef2ca174d813ca53deef1
2014-08-26 13:54:24 -07:00
Doug Zongker
f449db2f30 open misc device in write-only mode
Opening the misc block device in read-write mode runs afoul of
SELinux, which keeps the wipe code from working.  Fix.  Also change
various things to log to logcat so we can see them happening, for
future debugging.

Bug: 16715412
Change-Id: Ia14066f0a371cd605fcb544547b58a41acca70b9
2014-08-26 09:22:57 -07:00
Doug Zongker
1d5d6098f4 fix two bugs in block image updater
The computation of file offsets was overflowing for partitions larger
than 2 GB.  The parsing of the transfer file could fail at the end if
the data happened to not be properly null-terminated.

Bug: 16984795
Change-Id: I3ce6eb3e54ab7b55aa9bbed252da5a7eacd3317a
2014-08-21 10:47:24 -07:00
Doug Zongker
bc7ffeda98 installer for new block OTA system
(Cherry-pick back from master.)

Bug: 16984795
Change-Id: Ifa3d8345c5e2a0be86fb28faa080ca82592a96b4
2014-08-19 16:53:39 -07:00
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