Index: utils.cc |
diff --git a/utils.cc b/utils.cc |
index 359b6b8866a6fee79b5f242f91d4ea4720ce2d17..7b3c049d65ee4c0cb8c4f5028052b65dc3dee3a3 100644 |
--- a/utils.cc |
+++ b/utils.cc |
@@ -24,6 +24,7 @@ |
#include <base/rand_util.h> |
#include <base/string_util.h> |
#include <base/logging.h> |
+#include <cros_boot_mode/boot_mode.h> |
#include <rootdev/rootdev.h> |
#include "update_engine/file_writer.h" |
@@ -49,6 +50,14 @@ bool IsOOBEComplete() { |
return file_util::PathExists(FilePath(kOOBECompletedMarker)); |
} |
+bool IsNormalBootMode() { |
+ cros_boot_mode::BootMode mode; |
+ mode.Initialize(false, true); |
adlr
2011/01/07 22:44:08
perhaps a comment about what false, true means?
petkov
2011/01/07 22:50:45
Done.
|
+ bool normal = mode.mode() == cros_boot_mode::BootMode::kNormal; |
+ LOG_IF(INFO, !normal) << "Boot mode not normal: " << mode.mode_text(); |
+ return normal; |
+} |
+ |
bool WriteFile(const char* path, const char* data, int data_len) { |
DirectFileWriter writer; |
TEST_AND_RETURN_FALSE_ERRNO(0 == writer.Open(path, |