diff options
author | Mark Salyzyn <salyzyn@google.com> | 2016-04-04 16:19:26 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2016-04-04 16:24:48 -0700 |
commit | 5f7111ff4dc5055298d302b228f392a7a22a00a0 (patch) | |
tree | 0b0fd25e6deefb0ecb40c52bde528a4847c0fb0e /recovery-persist.cpp | |
parent | 81247500d535dac714fad657860b67474e1f6e42 (diff) |
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.cpp | 9 |
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"; static const char *LAST_PMSG_FILE = "/sys/fs/pstore/pmsg-ramoops-0"; static const char *LAST_KMSG_FILE = "/data/misc/recovery/last_kmsg"; static const char *LAST_CONSOLE_FILE = "/sys/fs/pstore/console-ramoops-0"; +static const char *ALT_LAST_CONSOLE_FILE = "/sys/fs/pstore/console-ramoops"; static const int KEEP_LOG_COUNT = 10; @@ -192,8 +193,12 @@ int main(int argc, char **argv) { LOG_ID_SYSTEM, ANDROID_LOG_INFO, "recovery/", logsave, NULL); /* Is there a last console log too? */ - if (rotated && !access(LAST_CONSOLE_FILE, R_OK)) { - copy_file(LAST_CONSOLE_FILE, LAST_KMSG_FILE); + if (rotated) { + if (!access(LAST_CONSOLE_FILE, R_OK)) { + copy_file(LAST_CONSOLE_FILE, LAST_KMSG_FILE); + } else if (!access(ALT_LAST_CONSOLE_FILE, R_OK)) { + copy_file(ALT_LAST_CONSOLE_FILE, LAST_KMSG_FILE); + } } return 0; |