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

Commit 192fdeb4 authored by Jiyong Park's avatar Jiyong Park
Browse files

/bionic path is gone

The path no longer exists, and thus the path doesn't need to be
unmounted upon remounting.

Bug: 125549215
Test: system/core/fs_mgr/tests/adb-remount-test.sh
Change-Id: I7b263c755ad7eeaa63a00ad9795a134707698625
parent fc97d2a1
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;
}