Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a232d9dc authored by Tianjie Xu's avatar Tianjie Xu Committed by Gerrit Code Review
Browse files

Merge "Move install to separate module"

parents 50bda24f 2478885f
Loading
Loading
Loading
Loading
+3 −70
Original line number Diff line number Diff line
@@ -63,32 +63,18 @@ cc_defaults {
        "libbootloader_message",
        "libcrypto",
        "libcutils",
        "libext4_utils",
        "libfs_mgr",
        "libfusesideload",
        "libhidl-gen-utils",
        "libhidlbase",
        "libhidltransport",
        "liblog",
        "libpng",
        "libselinux",
        "libtinyxml2",
        "libutils",
        "libz",
        "libziparchive",
    ],

    static_libs: [
        "librecovery_fastboot",
        "libminui",
        "libpackage",
        "libverifier",
        "libotautil",

        // external dependencies
        "libhealthhalutils",
        "libvintf_recovery",
        "libvintf",
        "libfstab",
    ],
}
@@ -102,69 +88,14 @@ cc_library_static {
    ],

    srcs: [
        "adb_install.cpp",
        "fsck_unshare_blocks.cpp",
        "fuse_sdcard_install.cpp",
        "install.cpp",
        "recovery.cpp",
        "roots.cpp",
    ],

    shared_libs: [
        "libinstall",
        "librecovery_ui",
    ],

    include_dirs: [
        "system/vold",
    ],
}

cc_library_static {
    name: "libverifier",
    recovery_available: true,

    defaults: [
        "recovery_defaults",
    ],

    srcs: [
        "asn1_decoder.cpp",
        "verifier.cpp",
    ],

    shared_libs: [
        "libbase",
        "libcrypto",
        "libcrypto_utils",
        "libziparchive",
    ],

    static_libs: [
        "libotautil",
    ],
}

cc_library_static {
    name: "libpackage",
    recovery_available: true,

    defaults: [
        "recovery_defaults",
    ],

    srcs: [
        "package.cpp",
    ],

    shared_libs: [
        "libbase",
        "libcrypto",
        "libziparchive",
    ],

    static_libs: [
        "libotautil",
    ],
}

cc_binary {
@@ -172,6 +103,7 @@ cc_binary {
    recovery: true,

    defaults: [
        "libinstall_defaults",
        "librecovery_defaults",
    ],

@@ -181,6 +113,7 @@ cc_binary {
    ],

    shared_libs: [
        "libinstall",
        "libminadbd_services",
        "librecovery_ui",
    ],
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ struct selabel_handle;

extern struct selabel_handle* sehandle;
extern RecoveryUI* ui;
extern bool modified_flash;
extern bool has_cache;

// The current stage, e.g. "1/2".
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#include <android-base/unique_fd.h>
#include <fstab/fstab.h>

#include "roots.h"
#include "otautil/roots.h"

static constexpr const char* SYSTEM_E2FSCK_BIN = "/system/bin/e2fsck_static";
static constexpr const char* TMP_E2FSCK_BIN = "/tmp/e2fsck.bin";

install/Android.bp

0 → 100644
+78 −0
Original line number Diff line number Diff line
// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

cc_defaults {
    name: "libinstall_defaults",

    defaults: [
        "recovery_defaults",
    ],

    shared_libs: [
        "libbase",
        "libbootloader_message",
        "libcrypto",
        "libext4_utils",
        "libfs_mgr",
        "libfusesideload",
        "libhidl-gen-utils",
        "libhidlbase",
        "libhidltransport",
        "liblog",
        "libselinux",
        "libtinyxml2",
        "libutils",
        "libz",
        "libziparchive",
    ],

    static_libs: [
        "libotautil",

        // external dependencies
        "libvintf_recovery",
        "libvintf",
        "libfstab",
    ],
}

cc_library {
    name: "libinstall",
    recovery_available: true,

    defaults: [
        "libinstall_defaults",
    ],

    srcs: [
        "adb_install.cpp",
        "asn1_decoder.cpp",
        "fuse_sdcard_install.cpp",
        "install.cpp",
        "package.cpp",
        "verifier.cpp",
    ],

    shared_libs: [
        "librecovery_ui",
    ],

    export_include_dirs: [
        "include",
    ],

    export_shared_lib_headers: [
        "librecovery_ui",
    ],
}
+9 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#include "adb_install.h"
#include "install/adb_install.h"

#include <errno.h>
#include <fcntl.h>
@@ -29,12 +29,16 @@
#include <android-base/logging.h>
#include <android-base/properties.h>

#include "common.h"
#include "fuse_sideload.h"
#include "install.h"
#include "install/install.h"
#include "recovery_ui/ui.h"

int apply_from_adb(bool* wipe_cache) {
static bool SetUsbConfig(const std::string& state) {
  android::base::SetProperty("sys.usb.config", state);
  return android::base::WaitForProperty("sys.usb.state", state);
}

int apply_from_adb(bool* wipe_cache, RecoveryUI* ui) {
  // Save the usb state to restore after the sideload operation.
  std::string usb_state = android::base::GetProperty("sys.usb.state", "none");
  // Clean up state and stop adbd.
@@ -85,7 +89,7 @@ int apply_from_adb(bool* wipe_cache) {
        break;
      }
    }
    result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, false, 0);
    result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, false, 0, ui);
    break;
  }

Loading