Merge "fsmgr: print unabbreviated log when exec child commands"
This commit is contained in:
commit
71fcaf5726
2 changed files with 10 additions and 9 deletions
|
|
@ -234,10 +234,11 @@ static void check_fs(const std::string& blk_device, const std::string& fs_type,
|
||||||
LINFO << "Running " << E2FSCK_BIN << " on " << realpath(blk_device);
|
LINFO << "Running " << E2FSCK_BIN << " on " << realpath(blk_device);
|
||||||
if (should_force_check(*fs_stat)) {
|
if (should_force_check(*fs_stat)) {
|
||||||
ret = logwrap_fork_execvp(ARRAY_SIZE(e2fsck_forced_argv), e2fsck_forced_argv,
|
ret = logwrap_fork_execvp(ARRAY_SIZE(e2fsck_forced_argv), e2fsck_forced_argv,
|
||||||
&status, false, LOG_KLOG | LOG_FILE, true, FSCK_LOG_FILE);
|
&status, false, LOG_KLOG | LOG_FILE, false,
|
||||||
|
FSCK_LOG_FILE);
|
||||||
} else {
|
} else {
|
||||||
ret = logwrap_fork_execvp(ARRAY_SIZE(e2fsck_argv), e2fsck_argv, &status, false,
|
ret = logwrap_fork_execvp(ARRAY_SIZE(e2fsck_argv), e2fsck_argv, &status, false,
|
||||||
LOG_KLOG | LOG_FILE, true, FSCK_LOG_FILE);
|
LOG_KLOG | LOG_FILE, false, FSCK_LOG_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
@ -256,11 +257,11 @@ static void check_fs(const std::string& blk_device, const std::string& fs_type,
|
||||||
if (should_force_check(*fs_stat)) {
|
if (should_force_check(*fs_stat)) {
|
||||||
LINFO << "Running " << F2FS_FSCK_BIN << " -f " << realpath(blk_device);
|
LINFO << "Running " << F2FS_FSCK_BIN << " -f " << realpath(blk_device);
|
||||||
ret = logwrap_fork_execvp(ARRAY_SIZE(f2fs_fsck_forced_argv), f2fs_fsck_forced_argv,
|
ret = logwrap_fork_execvp(ARRAY_SIZE(f2fs_fsck_forced_argv), f2fs_fsck_forced_argv,
|
||||||
&status, false, LOG_KLOG | LOG_FILE, true, FSCK_LOG_FILE);
|
&status, false, LOG_KLOG | LOG_FILE, false, FSCK_LOG_FILE);
|
||||||
} else {
|
} else {
|
||||||
LINFO << "Running " << F2FS_FSCK_BIN << " -a " << realpath(blk_device);
|
LINFO << "Running " << F2FS_FSCK_BIN << " -a " << realpath(blk_device);
|
||||||
ret = logwrap_fork_execvp(ARRAY_SIZE(f2fs_fsck_argv), f2fs_fsck_argv, &status, false,
|
ret = logwrap_fork_execvp(ARRAY_SIZE(f2fs_fsck_argv), f2fs_fsck_argv, &status, false,
|
||||||
LOG_KLOG | LOG_FILE, true, FSCK_LOG_FILE);
|
LOG_KLOG | LOG_FILE, false, FSCK_LOG_FILE);
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
/* No need to check for error in fork, we can't really handle it now */
|
/* No need to check for error in fork, we can't really handle it now */
|
||||||
|
|
@ -338,7 +339,7 @@ static bool tune2fs_available(void) {
|
||||||
static bool run_tune2fs(const char* argv[], int argc) {
|
static bool run_tune2fs(const char* argv[], int argc) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = logwrap_fork_execvp(argc, argv, nullptr, false, LOG_KLOG, true, nullptr);
|
ret = logwrap_fork_execvp(argc, argv, nullptr, false, LOG_KLOG, false, nullptr);
|
||||||
return ret == 0;
|
return ret == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ static int format_ext4(const std::string& fs_blkdev, const std::string& fs_mnt_p
|
||||||
mke2fs_args.push_back(fs_blkdev.c_str());
|
mke2fs_args.push_back(fs_blkdev.c_str());
|
||||||
mke2fs_args.push_back(size_str.c_str());
|
mke2fs_args.push_back(size_str.c_str());
|
||||||
|
|
||||||
rc = logwrap_fork_execvp(mke2fs_args.size(), mke2fs_args.data(), nullptr, false, LOG_KLOG, true,
|
rc = logwrap_fork_execvp(mke2fs_args.size(), mke2fs_args.data(), nullptr, false, LOG_KLOG,
|
||||||
nullptr);
|
false, nullptr);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
LERROR << "mke2fs returned " << rc;
|
LERROR << "mke2fs returned " << rc;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -97,7 +97,7 @@ static int format_ext4(const std::string& fs_blkdev, const std::string& fs_mnt_p
|
||||||
"/system/bin/e2fsdroid", "-e", "-a", fs_mnt_point.c_str(), fs_blkdev.c_str(), nullptr};
|
"/system/bin/e2fsdroid", "-e", "-a", fs_mnt_point.c_str(), fs_blkdev.c_str(), nullptr};
|
||||||
|
|
||||||
rc = logwrap_fork_execvp(arraysize(e2fsdroid_args), e2fsdroid_args, nullptr, false, LOG_KLOG,
|
rc = logwrap_fork_execvp(arraysize(e2fsdroid_args), e2fsdroid_args, nullptr, false, LOG_KLOG,
|
||||||
true, nullptr);
|
false, nullptr);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
LERROR << "e2fsdroid returned " << rc;
|
LERROR << "e2fsdroid returned " << rc;
|
||||||
}
|
}
|
||||||
|
|
@ -135,7 +135,7 @@ static int format_f2fs(const std::string& fs_blkdev, uint64_t dev_sz, bool crypt
|
||||||
args.push_back(fs_blkdev.c_str());
|
args.push_back(fs_blkdev.c_str());
|
||||||
args.push_back(size_str.c_str());
|
args.push_back(size_str.c_str());
|
||||||
|
|
||||||
return logwrap_fork_execvp(args.size(), args.data(), nullptr, false, LOG_KLOG, true, nullptr);
|
return logwrap_fork_execvp(args.size(), args.data(), nullptr, false, LOG_KLOG, false, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fs_mgr_do_format(const FstabEntry& entry, bool crypt_footer) {
|
int fs_mgr_do_format(const FstabEntry& entry, bool crypt_footer) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue