Merge "Fix failure on mounting system_ext partition" am: 8437b9a082 am: df10d96f4a am: 69eeff6580

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2442800

Change-Id: I1996bf55629d3f2ead4515925f889f82fd772727
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jiyong Park 2023-02-23 06:04:04 +00:00 committed by Automerger Merge Worker
commit 1363082fda

View file

@ -897,29 +897,31 @@ void MountMissingSystemPartitions() {
continue;
}
auto system_entry = GetEntryForMountPoint(&fstab, "/system");
if (!system_entry) {
LOG(ERROR) << "Could not find mount entry for /system";
break;
}
if (!system_entry->fs_mgr_flags.logical) {
LOG(INFO) << "Skipping mount of " << name << ", system is not dynamic.";
break;
}
auto system_entries = GetEntriesForMountPoint(&fstab, "/system");
for (auto& system_entry : system_entries) {
if (!system_entry) {
LOG(ERROR) << "Could not find mount entry for /system";
break;
}
if (!system_entry->fs_mgr_flags.logical) {
LOG(INFO) << "Skipping mount of " << name << ", system is not dynamic.";
break;
}
auto entry = *system_entry;
auto partition_name = name + fs_mgr_get_slot_suffix();
auto replace_name = "system"s + fs_mgr_get_slot_suffix();
auto entry = *system_entry;
auto partition_name = name + fs_mgr_get_slot_suffix();
auto replace_name = "system"s + fs_mgr_get_slot_suffix();
entry.mount_point = "/"s + name;
entry.blk_device =
entry.mount_point = "/"s + name;
entry.blk_device =
android::base::StringReplace(entry.blk_device, replace_name, partition_name, false);
if (!fs_mgr_update_logical_partition(&entry)) {
LOG(ERROR) << "Could not update logical partition";
continue;
}
if (!fs_mgr_update_logical_partition(&entry)) {
LOG(ERROR) << "Could not update logical partition";
continue;
}
extra_fstab.emplace_back(std::move(entry));
extra_fstab.emplace_back(std::move(entry));
}
}
SkipMountingPartitions(&extra_fstab, true /* verbose */);