diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2016-12-10 16:04:41 +0100 |
---|---|---|
committer | Dees Troy <dees_troy@teamw.in> | 2016-12-13 21:26:57 +0100 |
commit | ff2b7881c96c81d510481b92982d099e9101dbec (patch) | |
tree | 756d577a0784f8b6caa4b1f2e8f54daaa57dfdf6 /twrp-functions.cpp | |
parent | Support backup/restore of FBE policies (diff) | |
download | android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.tar android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.tar.gz android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.tar.bz2 android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.tar.lz android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.tar.xz android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.tar.zst android_bootable_recovery-ff2b7881c96c81d510481b92982d099e9101dbec.zip |
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r-- | twrp-functions.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp index 72674ae69..9b0356ff8 100644 --- a/twrp-functions.cpp +++ b/twrp-functions.cpp @@ -498,8 +498,14 @@ void TWFunc::Update_Log_File(void) { chown("/cache/recovery/log", 1000, 1000); chmod("/cache/recovery/log", 0600); chmod("/cache/recovery/last_log", 0640); + } else if (PartitionManager.Mount_By_Path("/data", false) && TWFunc::Path_Exists("/data/cache/recovery/.")) { + Copy_Log(TMP_LOG_FILE, "/data/cache/recovery/log"); + copy_file("/data/cache/recovery/log", "/data/cache/recovery/last_log", 600); + chown("/data/cache/recovery/log", 1000, 1000); + chmod("/data/cache/recovery/log", 0600); + chmod("/data/cache/recovery/last_log", 0640); } else { - LOGINFO("Failed to mount /cache for TWFunc::Update_Log_File\n"); + LOGINFO("Failed to mount /cache or find /data/cache for TWFunc::Update_Log_File\n"); } // Reset bootloader message @@ -515,7 +521,7 @@ void TWFunc::Update_Log_File(void) { } } - if (PartitionManager.Mount_By_Path("/cache", true)) { + if (PartitionManager.Mount_By_Path("/cache", false)) { if (unlink("/cache/recovery/command") && errno != ENOENT) { LOGINFO("Can't unlink %s\n", "/cache/recovery/command"); } |