Merge "recovery-persist: pick up both pstore console files" am: 901f315
am: 4195388

* commit '419538869d3e92270f748316f4956eeb431663c3':
  recovery-persist: pick up both pstore console files

Change-Id: I85571bfef8ab8f1a4f44c2a9138d3eaca78e57aa
diff --git a/recovery-persist.cpp b/recovery-persist.cpp
index 8587e9a..25df03f 100644
--- a/recovery-persist.cpp
+++ b/recovery-persist.cpp
@@ -50,6 +50,7 @@
 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 @@
         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;