update_engine: Use libchromeos to launch subprocesses.
The Subprocess class handles the execution of suprocesses in the
update_engine such as the post-install script and bspatch operations.
This patch migrates this class from using glib functions to use
libchromeos classes with equivalent functionality.
Callsites and unittests were updated to match the new interface.
BUG=chromium:499886
TEST=Unittest still pass. Deployed on link and cros flash another image
using a delta payload.
Change-Id: Ia64d39734e220675113f393a6049e9a9b0fe8409
Reviewed-on: https://chromium-review.googlesource.com/288837
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/update_attempter.h b/update_attempter.h
index 1326365..48d344f 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -112,10 +112,7 @@
void UpdateBootFlags();
// Subprocess::Exec callback.
- void CompleteUpdateBootFlags(int return_code);
- static void StaticCompleteUpdateBootFlags(int return_code,
- const std::string& output,
- void* p);
+ void CompleteUpdateBootFlags(int return_code, const std::string& output);
UpdateStatus status() const { return status_; }
@@ -469,8 +466,9 @@
// True if UpdateBootFlags is running.
bool update_boot_flags_running_ = false;
- // The command to run to set the current kernel as good.
- std::string set_good_kernel_cmd_ = "/usr/sbin/chromeos-setgoodkernel";
+ // Whether we should skip the async call to "setgoodkernel" command. Used in
+ // unittests.
+ bool skip_set_good_kernel_ = false;
// True if the action processor needs to be started by the boot flag updater.
bool start_action_processor_ = false;