summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-02-25 04:57:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-02-25 04:57:26 +0000
commitebb46d76e4bf4ee4f34b42709ea69cce07e3e322 (patch)
treee7d5afaee21077112ff88606288853b24f9a4ce4
parentd7590650dc7b36557efde7f63a6e904878572e12 (diff)
parent28483d7ec497e06850be1d8f87d7fa522c8ab9d4 (diff)
downloadsystem_core-ebb46d76e4bf4ee4f34b42709ea69cce07e3e322.zip
system_core-ebb46d76e4bf4ee4f34b42709ea69cce07e3e322.tar.gz
system_core-ebb46d76e4bf4ee4f34b42709ea69cce07e3e322.tar.bz2
Merge "fs_mgr: Don't run e2fsck inside SDK system images."
-rw-r--r--fs_mgr/fs_mgr.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index 4c2f247..dcda005 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -116,15 +116,24 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
umount(target);
}
- INFO("Running %s on %s\n", E2FSCK_BIN, blk_device);
+ /*
+ * 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,
- &status, true, LOG_KLOG | LOG_FILE,
- true, FSCK_LOG_FILE);
+ ret = android_fork_execvp_ext(ARRAY_SIZE(e2fsck_argv), e2fsck_argv,
+ &status, true, LOG_KLOG | LOG_FILE,
+ true, FSCK_LOG_FILE);
- if (ret < 0) {
- /* No need to check for error in fork, we can't really handle it now */
- ERROR("Failed trying to run %s\n", E2FSCK_BIN);
+ if (ret < 0) {
+ /* No need to check for error in fork, we can't really handle it now */
+ ERROR("Failed trying to run %s\n", E2FSCK_BIN);
+ }
}
}