Merge changes from topic "apex_earlymount_no_bionic_bindmount" am: 4cd0914048

am: a4015c04df

Change-Id: Ice90f6c9a2579575a667d9552d59ea6e8fdd2a39
This commit is contained in:
Jiyong Park 2019-03-15 02:31:26 -07:00 committed by android-build-merger
commit 943edd90ff

View file

@ -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;
}