update_engine: New BootControlInterface class.
The new BootControlInterface class is a platform-independent
abstraction to control the bootloader. It provides methods for setting
what partition slots are available for booting and getting the
bootloader status about the available slots.
The Chrome OS specific implementation of the bootloader was moved to
the BootControlChromeOS which now depends on the vboot_host
implementation used in Chrome OS. Follow up CL will implement the
equivalent class for Brillo.
BUG=b:23010637
TEST=unittests; cros flash from the new image and rolled back from it.
Change-Id: I0a03aeeb8c21d8c99e1866b625e6e8c96628215b
diff --git a/real_system_state.h b/real_system_state.h
index 9eaa6cb..a51e6ef 100644
--- a/real_system_state.h
+++ b/real_system_state.h
@@ -27,6 +27,7 @@
#include "debugd/dbus-proxies.h"
#include "login_manager/dbus-proxies.h"
#include "power_manager/dbus-proxies.h"
+#include "update_engine/boot_control_interface.h"
#include "update_engine/clock.h"
#include "update_engine/connection_manager.h"
#include "update_engine/hardware.h"
@@ -60,6 +61,10 @@
return device_policy_;
}
+ inline BootControlInterface* boot_control() override {
+ return boot_control_.get();
+ }
+
inline ClockInterface* clock() override { return &clock_; }
inline ConnectionManagerInterface* connection_manager() override {
@@ -112,6 +117,9 @@
LibCrosProxy libcros_proxy_;
// Interface for the clock.
+ std::unique_ptr<BootControlInterface> boot_control_;
+
+ // Interface for the clock.
Clock clock_;
// The latest device policy object from the policy provider.