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/updater.cpp b/tools/updater.cpp
index 0fcfe6f..25f7dab 100644
--- a/tools/updater.cpp
+++ b/tools/updater.cpp
@@ -36,7 +36,7 @@
void updaterMain(UpdateHandlerInterface* updater, const std::string& imagePath,
const std::string& signaturePath,
- const std::string& layoutType)
+ const std::string& layoutType, bool ignoreUpdate)
{
/* TODO: validate the layoutType isn't a special value such as: 'update',
* 'verify', or 'hash'
@@ -63,7 +63,7 @@
/* Trigger the verification by opening and committing the verify file.
*/
std::fprintf(stderr, "Opening the verification file\n");
- if (updater->verifyFile(ipmi_flash::verifyBlobId))
+ if (updater->verifyFile(ipmi_flash::verifyBlobId, false))
{
std::fprintf(stderr, "succeeded\n");
}
@@ -75,7 +75,7 @@
/* Trigger the update by opening and committing the update file. */
std::fprintf(stderr, "Opening the update file\n");
- if (updater->verifyFile(ipmi_flash::updateBlobId))
+ if (updater->verifyFile(ipmi_flash::updateBlobId, ignoreUpdate))
{
std::fprintf(stderr, "succeeded\n");
}