aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker2014-06-26 17:35:51 -0500
committerDoug Zongker2014-07-02 14:16:36 -0500
commit075ad800c539503d0515e5e0b4af160eccedead9 (patch)
tree0fa4e4f99556393317ae486eb66aeb3cbad220df /install.h
parente8d7dd4ed1a372cb9bf67a1f7ff55aaa3e152053 (diff)
downloadplatform-bootable-recovery-075ad800c539503d0515e5e0b4af160eccedead9.tar.gz
platform-bootable-recovery-075ad800c539503d0515e5e0b4af160eccedead9.tar.xz
platform-bootable-recovery-075ad800c539503d0515e5e0b4af160eccedead9.zip
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
Diffstat (limited to 'install.h')
-rw-r--r--install.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/install.h b/install.h
index 2ada529e..53c0d312 100644
--- a/install.h
+++ b/install.h
@@ -28,7 +28,7 @@ enum { INSTALL_SUCCESS, INSTALL_ERROR, INSTALL_CORRUPT, INSTALL_NONE };
28// returned and *wipe_cache is true on exit, caller should wipe the 28// returned and *wipe_cache is true on exit, caller should wipe the
29// cache partition. 29// cache partition.
30int install_package(const char *root_path, int* wipe_cache, 30int install_package(const char *root_path, int* wipe_cache,
31 const char* install_file); 31 const char* install_file, bool needs_mount);
32 32
33#ifdef __cplusplus 33#ifdef __cplusplus
34} 34}