Copy Kernel Logs

Give user option to copy kernel logs to current storage

Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd
This commit is contained in:
bigbiff bigbiff
2016-12-01 19:00:02 -05:00
parent 3fdcda4662
commit bad332a3d1
7 changed files with 136 additions and 32 deletions
+9 -3
View File
@@ -639,13 +639,19 @@ int GUIAction::copylog(std::string arg __unused)
operation_start("Copy Log");
if (!simulate)
{
string dst;
string dst, curr_storage;
int copy_kernel_log = 0;
DataManager::GetValue("tw_include_kernel_log", copy_kernel_log);
PartitionManager.Mount_Current_Storage(true);
dst = DataManager::GetCurrentStoragePath() + "/recovery.log";
curr_storage = DataManager::GetCurrentStoragePath();
dst = curr_storage + "/recovery.log";
TWFunc::copy_file("/tmp/recovery.log", dst.c_str(), 0755);
tw_set_default_metadata(dst.c_str());
if (copy_kernel_log)
TWFunc::copy_kernel_log(curr_storage);
sync();
gui_msg(Msg("copy_log=Copied recovery log to {1}.")(DataManager::GetCurrentStoragePath()));
gui_msg(Msg("copy_log=Copied recovery log to {1}")(dst));
} else
simulate_progress_bar();
operation_end(0);