Commit Graph

896 Commits

Author SHA1 Message Date
The Android Automerger
4cd02aeaeb merge in lmp-release history after reset to 574443d895 2014-09-14 06:09:36 -07:00
The Android Automerger
c02b9ef11f merge in lmp-release history after reset to 5e238a9971 2014-09-13 08:42:01 -07:00
The Android Automerger
9bcc1875c0 merge in lmp-release history after reset to 574443d895 2014-09-13 06:09:54 -07:00
The Android Automerger
5e238a9971 merge in lmp-release history after reset to 574443d895 2014-09-11 06:09:10 -07:00
The Android Automerger
f6eb389525 merge in lmp-release history after reset to 574443d895 2014-09-10 06:09:16 -07:00
The Android Automerger
4fc827e933 merge in lmp-release history after reset to 574443d895 2014-09-09 06:09:24 -07:00
The Android Automerger
9c574d1d2a merge in lmp-release history after reset to 574443d895 2014-09-08 06:09:43 -07:00
The Android Automerger
500c1fb27c merge in lmp-release history after reset to 574443d895 2014-09-07 06:08:57 -07:00
The Android Automerger
c398172f94 merge in lmp-release history after reset to f9bc2a544d 2014-09-06 08:50:41 -07:00
The Android Automerger
9132bd040b merge in lmp-release history after reset to 574443d895 2014-09-06 06:08:47 -07:00
Doug Zongker
f9bc2a544d 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 13:06:47 -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
The Android Automerger
603a1609fb merge in lmp-release history after reset to 5f875bf577 2014-09-04 06:09:32 -07:00
The Android Automerger
41f13f4276 merge in lmp-release history after reset to 5f875bf577 2014-09-03 06:09:06 -07:00
The Android Automerger
cdbd52f5a3 merge in lmp-release history after reset to 5f875bf577 2014-09-02 06:09:10 -07:00
The Android Automerger
c7709c56c2 merge in lmp-release history after reset to 5f875bf577 2014-09-01 07:54:47 -07:00
The Android Automerger
afe031d2ca merge in lmp-release history after reset to 5f875bf577 2014-08-31 09:30:23 -07:00
The Android Automerger
5e7308a59c merge in lmp-release history after reset to 5f875bf577 2014-08-27 06:09:32 -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
The Android Automerger
ff14eb2895 merge in lmp-release history after reset to lmp-dev 2014-08-26 11:14:05 -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
The Android Automerger
22427ff6d2 merge in lmp-release history after reset to 1d5d6098f4 2014-08-26 06:09:10 -07:00
The Android Automerger
8315f88e6d merge in lmp-release history after reset to 1d5d6098f4 2014-08-25 06:08:47 -07:00
The Android Automerger
19eeee5a9e merge in lmp-release history after reset to 1d5d6098f4 2014-08-24 06:08:25 -07:00
The Android Automerger
796e556e8f merge in lmp-release history after reset to 1d5d6098f4 2014-08-23 06:09:07 -07:00
Doug Zongker
f2127b6435 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 14:51:41 -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
The Android Automerger
314b3e31c3 merge in lmp-release history after reset to bc7ffeda98 2014-08-21 06:09:27 -07:00
The Android Automerger
c96ad7837b merge in lmp-release history after reset to bc7ffeda98 2014-08-20 06:08:55 -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
The Android Automerger
7f48b43e23 merge in lmp-release history after reset to 2efc9d994c 2014-08-19 06:08:53 -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
The Android Automerger
e5645ff3a2 merge in lmp-release history after reset to 1a35a58690 2014-08-18 06:08:42 -07:00
The Android Automerger
3c5bfe5b58 merge in lmp-release history after reset to 1a35a58690 2014-08-17 07:14:35 -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
64be82755c change uncrypt to static linking
Bug: 17015157
Change-Id: I3c4bdcf4f11d44b617bb731a48413e3707044d1c
2014-08-14 09:15:23 -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