save the recovery log from before HTC firmware updates

When doing a firmware (radio or hboot) update on HTC devices, save the
recovery log in block 1 of the cache partition, before the firmware
image and the UI bitmaps.  When we boot back into recovery after the
firmware update to reformat the cache partition, copy that log out of
cache before reformatting it and dump it into the current invocation's
log.

The practical upshot of all this is that we can see the log output
from radio and hboot updates.

Change-Id: Ie0e89566754c88f4bed6a90d8a0aa04047b01a27
diff --git a/recovery.c b/recovery.c
index 58c84ef..1a88560 100644
--- a/recovery.c
+++ b/recovery.c
@@ -46,6 +46,7 @@
   { "wipe_cache", no_argument, NULL, 'c' },
   // TODO{oam}: implement improved command line passing key, egnot to review.
   { "set_encrypted_filesystem", required_argument, NULL, 'e' },
+  { "recover_log", no_argument, NULL, 'g' },
   { NULL, 0, NULL, 0 },
 };
 
@@ -491,6 +492,7 @@
         case 'w': wipe_data = wipe_cache = 1; break;
         case 'c': wipe_cache = 1; break;
         case 'e': efs_mode = optarg; toggle_efs = 1; break;
+        case 'g': recover_firmware_update_log(); break;
         case '?':
             LOGE("Invalid command argument\n");
             continue;
@@ -562,7 +564,7 @@
     if (status != INSTALL_SUCCESS || ui_text_visible()) prompt_and_wait();
 
     // If there is a radio image pending, reboot now to install it.
-    maybe_install_firmware_update(send_intent);
+    maybe_install_firmware_update(send_intent, TEMPORARY_LOG_FILE);
 
     // Otherwise, get ready to boot the main system...
     finish_recovery(send_intent);