summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorKen Sumrall <ksumrall@android.com>2013-09-18 17:49:21 -0700
committerKen Sumrall <ksumrall@android.com>2013-09-20 17:44:33 -0700
commit4eaf905858c6a1d7cf0639bed3e8de3bd7987646 (patch)
treef787ab75ca22a15793b190de894ca13a7f73d0a5 /fs_mgr
parent887f2892062c64fa688fc9525ebd09cc98ca70d8 (diff)
downloadsystem_core-4eaf905858c6a1d7cf0639bed3e8de3bd7987646.tar.gz
system_core-4eaf905858c6a1d7cf0639bed3e8de3bd7987646.tar.bz2
system_core-4eaf905858c6a1d7cf0639bed3e8de3bd7987646.zip
Create a separate copy of the fsck logs
The log_target parameter of android_fork_execvp_ext() is now a bit field, and multiple targets can be set to log to multiple places at the same time. The new target LOG_FILE will log to a file specified by the new parameter file_path. Set LOG_FILE and log to a file in /dev (the only writable filesystem avilable when e2fsck runs) when invoking e2fsck in fs_mgr. Bug: 10021342 Change-Id: I63baf644cc8c3afccc8345df27a74203b44d0400
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index ea60cc899..3500c911a 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -53,6 +53,8 @@
#define E2FSCK_BIN "/system/bin/e2fsck"
#define MKSWAP_BIN "/system/bin/mkswap"
+#define FSCK_LOG_FILE "/dev/fscklogs/log"
+
#define ZRAM_CONF_DEV "/sys/block/zram0/disksize"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
@@ -484,7 +486,8 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
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, true);
+ &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 */
@@ -801,7 +804,7 @@ int fs_mgr_swapon_all(struct fstab *fstab)
/* Initialize the swap area */
mkswap_argv[1] = fstab->recs[i].blk_device;
err = android_fork_execvp_ext(ARRAY_SIZE(mkswap_argv), mkswap_argv,
- &status, true, LOG_KLOG, false);
+ &status, true, LOG_KLOG, false, NULL);
if (err) {
ERROR("mkswap failed for %s\n", fstab->recs[i].blk_device);
ret = -1;