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

Commit a4015c04 authored by Jiyong Park's avatar Jiyong Park Committed by android-build-merger
Browse files

Merge changes from topic "apex_earlymount_no_bionic_bindmount"

am: 4cd09140

Change-Id: If31c1ac798d3aacd2a2aaa1f1c6e0695e3952a82
parents 8b9fa0a4 4cd09140
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -80,29 +80,6 @@ const android::fs_mgr::FstabEntry* is_wrapped(const android::fs_mgr::Fstab& over
    return &(*it);
}

void try_unmount_bionic(android::fs_mgr::Fstab* mounts) {
    static constexpr const char* kBionic = "/bionic";

    auto entry = GetEntryForMountPoint(mounts, kBionic);
    if (!entry) return;

    struct statfs buf;
    if (::statfs(kBionic, &buf) == -1) {
        PLOG(ERROR) << "statfs of " << kBionic;
        return;
    }
    if (buf.f_flags & MS_RDONLY) {
        // /bionic is on a read-only partition; can happen for
        // non-system-as-root-devices. Don' try to unmount.
        return;
    }
    fs_mgr_set_blk_ro(entry->blk_device, false);
    if (::mount(entry->blk_device.c_str(), entry->mount_point.c_str(), entry->fs_type.c_str(),
                MS_REMOUNT, nullptr) == -1) {
        PLOG(ERROR) << "remount of " << kBionic;
    }
}

void MyLogger(android::base::LogId id, android::base::LogSeverity severity, const char* tag,
              const char* file, unsigned int line, const char* message) {
    static const char log_characters[] = "VD\0WEFF";
@@ -395,7 +372,5 @@ int main(int argc, char* argv[]) {

    if (reboot_later) reboot(false);

    try_unmount_bionic(&mounts);

    return retval;
}