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

Commit 5a87356c authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5342135 from d821ae98 to qt-release

Change-Id: Ib5214a29e8832b1a3a864d767cc19e6bdc16fdb8
parents 4211f5bd d821ae98
Loading
Loading
Loading
Loading
+32 −27
Original line number Diff line number Diff line
@@ -638,20 +638,24 @@ int install_multi_package(int argc, const char** argv) {
        fprintf(stdout, "Created child session ID %d.\n", session_id);
        session_ids.push_back(session_id);

        // Support splitAPKs by allowing the notation split1.apk:split2.apk:split3.apk as argument.
        std::vector<std::string> splits = android::base::Split(file, ":");

        for (const std::string& split : splits) {
            struct stat sb;
        if (stat(file, &sb) == -1) {
            fprintf(stderr, "adb: failed to stat %s: %s\n", file, strerror(errno));
            if (stat(split.c_str(), &sb) == -1) {
                fprintf(stderr, "adb: failed to stat %s: %s\n", split.c_str(), strerror(errno));
                goto finalize_multi_package_session;
            }

        std::string cmd =
                android::base::StringPrintf("%s install-write -S %" PRIu64 " %d %d_%s -",
                                            install_cmd.c_str(), static_cast<uint64_t>(sb.st_size),
                                            session_id, i, android::base::Basename(file).c_str());
            std::string cmd = android::base::StringPrintf(
                    "%s install-write -S %" PRIu64 " %d %d_%s -", install_cmd.c_str(),
                    static_cast<uint64_t>(sb.st_size), session_id, i,
                    android::base::Basename(split).c_str());

        unique_fd local_fd(adb_open(file, O_RDONLY | O_CLOEXEC));
            unique_fd local_fd(adb_open(split.c_str(), O_RDONLY | O_CLOEXEC));
            if (local_fd < 0) {
            fprintf(stderr, "adb: failed to open %s: %s\n", file, strerror(errno));
                fprintf(stderr, "adb: failed to open %s: %s\n", split.c_str(), strerror(errno));
                goto finalize_multi_package_session;
            }

@@ -666,11 +670,11 @@ int install_multi_package(int argc, const char** argv) {
            read_status_line(remote_fd.get(), buf, sizeof(buf));

            if (strncmp("Success", buf, 7)) {
            fprintf(stderr, "adb: failed to write %s\n", file);
                fprintf(stderr, "adb: failed to write %s\n", split.c_str());
                fputs(buf, stderr);
                goto finalize_multi_package_session;
            }

        }
        all_session_ids += android::base::StringPrintf(" %d", session_id);
    }

@@ -718,6 +722,7 @@ finalize_multi_package_session:
        fputs(buf, stderr);
    }

    session_ids.push_back(parent_session_id);
    // try to abandon all remaining sessions
    for (std::size_t i = 0; i < session_ids.size(); i++) {
        service = android::base::StringPrintf("%s install-abandon %d", install_cmd.c_str(),
+32 −0
Original line number Diff line number Diff line
@@ -111,3 +111,35 @@ cc_library_static {
        "libgsi_headers",
    ],
}

cc_binary {
    name: "remount",
    defaults: ["fs_mgr_defaults"],
    static_libs: [
        "libavb_user",
    ],
    shared_libs: [
        "libbootloader_message",
        "libbase",
        "libcrypto",
        "libfec",
        "libfs_mgr",
    ],
    header_libs: [
        "libcutils_headers",
    ],
    srcs: [
        "fs_mgr_remount.cpp",
    ],
    cppflags: [
        "-DALLOW_ADBD_DISABLE_VERITY=0",
    ],
    product_variables: {
        debuggable: {
            cppflags: [
                "-UALLOW_ADBD_DISABLE_VERITY",
                "-DALLOW_ADBD_DISABLE_VERITY=1",
            ],
        },
    },
}
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ Caveats
  and thus free dynamic partition space.
- Kernel must have CONFIG_OVERLAY_FS=y and will need to be patched
  with "*overlayfs: override_creds=off option bypass creator_cred*"
  if kernel is higher than 4.6.
  if kernel is 4.4 or higher.
  The patch is available on the upstream mailing list and the latest as of
  Feb 8 2019 is https://lore.kernel.org/patchwork/patch/1009299/.
  This patch adds an override_creds _mount_ option to overlayfs that
+2 −2
Original line number Diff line number Diff line
@@ -1089,7 +1089,7 @@ int fs_mgr_mount_all(Fstab* fstab, int mount_mode) {
                // Skips mounting the device.
                continue;
            }
        } else if (!current_entry.avb_key.empty()) {
        } else if (!current_entry.avb_keys.empty()) {
            if (AvbHandle::SetUpStandaloneAvbHashtree(&current_entry) == AvbHashtreeResult::kFail) {
                LERROR << "Failed to set up AVB on standalone partition: "
                       << current_entry.mount_point << ", skipping!";
@@ -1320,7 +1320,7 @@ static int fs_mgr_do_mount_helper(Fstab* fstab, const std::string& n_name,
                // Skips mounting the device.
                continue;
            }
        } else if (!fstab_entry.avb_key.empty()) {
        } else if (!fstab_entry.avb_keys.empty()) {
            if (AvbHandle::SetUpStandaloneAvbHashtree(&fstab_entry) == AvbHashtreeResult::kFail) {
                LERROR << "Failed to set up AVB on standalone partition: "
                       << fstab_entry.mount_point << ", skipping!";
+4 −3
Original line number Diff line number Diff line
@@ -325,8 +325,8 @@ void ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) {
            }
        } else if (StartsWith(flag, "zram_backing_dev_path=")) {
            entry->zram_backing_dev_path = arg;
        } else if (StartsWith(flag, "avb_key=")) {
            entry->avb_key = arg;
        } else if (StartsWith(flag, "avb_keys=")) {
            entry->avb_keys = arg;
        } else {
            LWARNING << "Warning: unknown flag: " << flag;
        }
@@ -759,7 +759,8 @@ FstabEntry BuildGsiSystemFstabEntry() {
                         .fs_type = "ext4",
                         .flags = MS_RDONLY,
                         .fs_options = "barrier=1",
                         .avb_key = "/gsi.avbpubkey",
                         // could add more keys separated by ':'.
                         .avb_keys = "/avb/gsi.avbpubkey:",
                         .logical_partition_name = "system"};
    system.fs_mgr_flags.wait = true;
    system.fs_mgr_flags.logical = true;
Loading