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

Commit 28483d7e authored by David 'Digit' Turner's avatar David 'Digit' Turner
Browse files

fs_mgr: Don't run e2fsck inside SDK system images.

These images do not have GPL-ed binaries like /system/bin/e2fsck so
avoid running the program when we detect that we're running inside
one of them.

Note that this does not affect other emulator-based build products
(e..g full-eng instead of sdk-eng), which do have the binaries.

BUG=13057123

Change-Id: Ia42f1d02a3845fbf4b2f9d95818f35d760711a12
parent deb3eecd
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -116,6 +116,14 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
            umount(target);
        }

        /*
         * Some system images do not have e2fsck for licensing reasons
         * (e.g. recent SDK system images). Detect these and skip the check.
         */
        if (access(E2FSCK_BIN, X_OK)) {
            INFO("Not running %s on %s (executable not in system image)\n",
                 E2FSCK_BIN, blk_device);
        } else {
            INFO("Running %s on %s\n", E2FSCK_BIN, blk_device);

            ret = android_fork_execvp_ext(ARRAY_SIZE(e2fsck_argv), e2fsck_argv,
@@ -127,6 +135,7 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
                ERROR("Failed trying to run %s\n", E2FSCK_BIN);
            }
        }
    }

    return;
}