tools: Add ignoreUpdate parameter

Adds ignoreUpdate flag to skip checking the update status and always
return success instead. This is needed for platforms that use the reboot
json and encounters an update failure due to IPMI going down during
shutdown.

Tested: Tried out an update with and without --ignore-update to verify
that the flag ignores the update status and returns success.

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: Ie20774f997229cd5ff8ae9082dc8a747079f9a2c
diff --git a/tools/handler.cpp b/tools/handler.cpp
index 65596f5..711e2f3 100644
--- a/tools/handler.cpp
+++ b/tools/handler.cpp
@@ -106,7 +106,7 @@
     blob->closeBlob(session);
 }
 
-bool UpdateHandler::verifyFile(const std::string& target)
+bool UpdateHandler::verifyFile(const std::string& target, bool ignoreStatus)
 {
     std::uint16_t session;
     bool success = false;
@@ -137,6 +137,13 @@
                             std::string(b.what()));
     }
 
+    if (ignoreStatus)
+    {
+        // Skip checking the blob for status if ignoreStatus is enabled
+        blob->closeBlob(session);
+        return true;
+    }
+
     std::fprintf(stderr, "Calling stat on %s session to check status\n",
                  target.c_str());