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

Commit ccd094cd authored by Lianjun Huang's avatar Lianjun Huang
Browse files

Fix failure on mounting system_ext partition



There can be more than one fstab entry of system partition.
For example, the filesystem of one entry is ext4 and another is erofs.

system /system ext4 ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey
system /system erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey

If both filesystems of system and system_ext paritions are erofs,
only the ext4 fstab entry will be returned by GetEntryForMountPoint,
and system_ext cann't be mounted.

So we need to return both of the fstab entries and try all of them.

Signed-off-by: default avatarLianjun Huang <huanglianjun@xiaomi.com>
Change-Id: I407553d48b1749cd0554f057a6bfd38daa96fdcb
Signed-off-by: default avatarLianjun Huang <huanglianjun@xiaomi.corp-partner.google.com>
parent 16ab2b67
Loading
Loading
Loading
Loading
+21 −19
Original line number Diff line number Diff line
@@ -897,7 +897,8 @@ void MountMissingSystemPartitions() {
            continue;
        }

        auto system_entry = GetEntryForMountPoint(&fstab, "/system");
        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;
@@ -921,6 +922,7 @@ void MountMissingSystemPartitions() {

            extra_fstab.emplace_back(std::move(entry));
        }
    }

    SkipMountingPartitions(&extra_fstab, true /* verbose */);
    if (extra_fstab.empty()) {