From bad332a3d175687a732cc6e94c34bd38bdef29b8 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Fri, 29 Jul 2016 21:18:13 -0400 Subject: Copy Kernel Logs Give user option to copy kernel logs to current storage Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd --- twrp-functions.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'twrp-functions.cpp') diff --git a/twrp-functions.cpp b/twrp-functions.cpp index cbf473016..72674ae69 100644 --- a/twrp-functions.cpp +++ b/twrp-functions.cpp @@ -1070,4 +1070,14 @@ unsigned long long TWFunc::IOCTL_Get_Block_Size(const char* block_device) { return 0; } +void TWFunc::copy_kernel_log(string curr_storage) { + std::string dmesgDst = curr_storage + "/dmesg.log"; + std::string dmesgCmd = "/sbin/dmesg"; + + std::string result; + Exec_Cmd(dmesgCmd, result); + write_file(dmesgDst, result); + gui_msg(Msg("copy_kernel_log=Copied kernel log to {1}")(dmesgDst)); + tw_set_default_metadata(dmesgDst.c_str()); +} #endif // ndef BUILD_TWRPTAR_MAIN -- cgit v1.2.3