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

Commit 504b4e9c authored by Nick Kralevich's avatar Nick Kralevich Committed by Android (Google) Code Review
Browse files

Merge "sdcard: ensure installd fs upgrade has completed" into lmp-dev

parents 2befa73f 8d28fa71
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1857,6 +1857,7 @@ int main(int argc, char **argv)
    bool split_perms = false;
    int i;
    struct rlimit rlim;
    int fs_version;

    int opt;
    while ((opt = getopt(argc, argv, "u:g:w:t:dls")) != -1) {
@@ -1931,6 +1932,11 @@ int main(int argc, char **argv)
        ERROR("Error setting RLIMIT_NOFILE, errno = %d\n", errno);
    }

    while ((fs_read_atomic_int("/data/.layout_version", &fs_version) == -1) || (fs_version < 3)) {
        ERROR("installd fs upgrade not yet complete. Waiting...\n");
        sleep(1);
    }

    res = run(source_path, dest_path, uid, gid, write_gid, num_threads, derive, split_perms);
    return res < 0 ? 1 : 0;
}