Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Unified Diff: main.cc

Issue 3117033: AU: call script to set boot flags on successful boot. (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: cleanup for review Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: main.cc
diff --git a/main.cc b/main.cc
index 3ae1e4bec40b1e089e12e310918301d3c34ca92c..f449fa401ece16536a0f9377eae0fe6ace3daa5a 100644
--- a/main.cc
+++ b/main.cc
@@ -11,10 +11,12 @@
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/string_util.h"
#include "metrics/metrics_library.h"
#include "update_engine/dbus_constants.h"
#include "update_engine/dbus_service.h"
#include "update_engine/prefs.h"
+#include "update_engine/subprocess.h"
#include "update_engine/update_attempter.h"
#include "update_engine/utils.h"
@@ -33,6 +35,14 @@ using std::vector;
namespace chromeos_update_engine {
+gboolean UpdateBootFlags(void* arg) {
+ // This purely best effort. Failures should be logged by Subprocess.
+ int unused = 0;
+ vector<string> cmd(1, "/usr/sbin/chromeos-setgoodkernel");
+ Subprocess::SynchronousExec(cmd, &unused);
+ return FALSE; // Don't call this callback again
+}
+
namespace {
gboolean UpdateOnce(void* arg) {
@@ -147,6 +157,9 @@ int main(int argc, char** argv) {
chromeos_update_engine::SchedulePeriodicUpdateChecks(&update_attempter);
+ // Update boot flags after 45 seconds
+ g_timeout_add_seconds(45, &chromeos_update_engine::UpdateBootFlags, NULL);
+
// Run the main loop until exit time:
g_main_loop_run(loop);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698