aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-04-04 18:19:26 -0500
committerMark Salyzyn2016-04-04 18:24:48 -0500
commit5f7111ff4dc5055298d302b228f392a7a22a00a0 (patch)
tree0b0fd25e6deefb0ecb40c52bde528a4847c0fb0e /recovery-persist.cpp
parent81247500d535dac714fad657860b67474e1f6e42 (diff)
downloadplatform-bootable-recovery-5f7111ff4dc5055298d302b228f392a7a22a00a0.tar.gz
platform-bootable-recovery-5f7111ff4dc5055298d302b228f392a7a22a00a0.tar.xz
platform-bootable-recovery-5f7111ff4dc5055298d302b228f392a7a22a00a0.zip
recovery-persist: pick up both pstore console files
- Volantis console-ramoops-0 (upstream correct) - Angler console-ramoops - Bullhead console-ramoops - Shamu console-ramoops NB: Shamu also has kernel crashes in other pstore files, not merging them in. Bug: 27176738 Change-Id: Ib6eef3e25475935b89252f51c960719c7860511a
Diffstat (limited to 'recovery-persist.cpp')
-rw-r--r--recovery-persist.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/recovery-persist.cpp b/recovery-persist.cpp
index 8587e9a6..25df03f4 100644
--- a/recovery-persist.cpp
+++ b/recovery-persist.cpp
@@ -50,6 +50,7 @@ static const char *LAST_LOG_FILE = "/data/misc/recovery/last_log";
50static const char *LAST_PMSG_FILE = "/sys/fs/pstore/pmsg-ramoops-0"; 50static const char *LAST_PMSG_FILE = "/sys/fs/pstore/pmsg-ramoops-0";
51static const char *LAST_KMSG_FILE = "/data/misc/recovery/last_kmsg"; 51static const char *LAST_KMSG_FILE = "/data/misc/recovery/last_kmsg";
52static const char *LAST_CONSOLE_FILE = "/sys/fs/pstore/console-ramoops-0"; 52static const char *LAST_CONSOLE_FILE = "/sys/fs/pstore/console-ramoops-0";
53static const char *ALT_LAST_CONSOLE_FILE = "/sys/fs/pstore/console-ramoops";
53 54
54static const int KEEP_LOG_COUNT = 10; 55static const int KEEP_LOG_COUNT = 10;
55 56
@@ -192,8 +193,12 @@ int main(int argc, char **argv) {
192 LOG_ID_SYSTEM, ANDROID_LOG_INFO, "recovery/", logsave, NULL); 193 LOG_ID_SYSTEM, ANDROID_LOG_INFO, "recovery/", logsave, NULL);
193 194
194 /* Is there a last console log too? */ 195 /* Is there a last console log too? */
195 if (rotated && !access(LAST_CONSOLE_FILE, R_OK)) { 196 if (rotated) {
196 copy_file(LAST_CONSOLE_FILE, LAST_KMSG_FILE); 197 if (!access(LAST_CONSOLE_FILE, R_OK)) {
198 copy_file(LAST_CONSOLE_FILE, LAST_KMSG_FILE);
199 } else if (!access(ALT_LAST_CONSOLE_FILE, R_OK)) {
200 copy_file(ALT_LAST_CONSOLE_FILE, LAST_KMSG_FILE);
201 }
197 } 202 }
198 203
199 return 0; 204 return 0;