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/" 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
diff --git a/install.cpp b/install.cpp
index 0f05960..9db5640 100644
--- a/install.cpp
+++ b/install.cpp
@@ -182,7 +182,7 @@
 static int
-really_install_package(const char *path, int* wipe_cache)
+really_install_package(const char *path, int* wipe_cache, bool needs_mount)
     ui->Print("Finding update package...\n");
@@ -194,7 +194,7 @@
     // Map the update package into memory.
     ui->Print("Opening update package...\n");
-    if (path) {
+    if (path && needs_mount) {
         if (path[0] == '@') {
         } else {
@@ -244,6 +244,7 @@
     int result = try_update_binary(path, &zip, wipe_cache);
+    ui->Print("\n");
@@ -251,7 +252,8 @@
-install_package(const char* path, int* wipe_cache, const char* install_file)
+install_package(const char* path, int* wipe_cache, const char* install_file,
+                bool needs_mount)
     FILE* install_log = fopen_path(install_file, "w");
     if (install_log) {
@@ -265,7 +267,7 @@
         LOGE("failed to set up expected mounts for install; aborting\n");
         result = INSTALL_ERROR;
     } else {
-        result = really_install_package(path, wipe_cache);
+        result = really_install_package(path, wipe_cache, needs_mount);
     if (install_log) {
         fputc(result == INSTALL_SUCCESS ? '1' : '0', install_log);