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

Commit 3f014a2a authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

fs_mgr: overlayfs: system as root can not detect shared blocks (taimen)

init first stage manufactures a / mount pointing to /dev/root and
we can not use that for checking the filesystem.  Result is /system
overlay is mounted in second stage.

This adjustment to special case /dev/root is safe for overlayfs
handling because we will also gate on content in
/mnt/scratch/overlay/system, which will not be set during runtime
setup because check will have the proper block device at that time.

Test: adb-remount-test.sh
Bug: 123079041
Change-Id: I9c6674163955155f26ad2b0c9b78e9ff6507a514
parent 61b20168
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -157,7 +157,12 @@ bool fs_mgr_overlayfs_enabled(FstabEntry* entry) {
        fs_mgr_update_logical_partition(entry);
    }
    auto save_errno = errno;
    errno = 0;
    auto has_shared_blocks = fs_mgr_has_shared_blocks(entry->mount_point, entry->blk_device);
    // special case for first stage init for system as root (taimen)
    if (!has_shared_blocks && (errno == ENOENT) && (entry->blk_device == "/dev/root")) {
        has_shared_blocks = true;
    }
    errno = save_errno;
    return has_shared_blocks;
}