flash-ipmi: implement flashDataVerify
Change-Id: Ibd0d3521c6656850dc545156faca6f6ede3925ba
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/flash-ipmi.cpp b/flash-ipmi.cpp
index e4fafc7..6c75835 100644
--- a/flash-ipmi.cpp
+++ b/flash-ipmi.cpp
@@ -19,6 +19,13 @@
#include <cstdio>
#include <fstream>
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/bus.hpp>
+
+/* systemd service to kick start a service. */
+static constexpr auto systemdService = "org.freedesktop.systemd1";
+static constexpr auto systemdRoot = "/org/freedesktop/systemd1";
+static constexpr auto systemdInterface = "org.freedesktop.systemd1.Manager";
+static constexpr auto verifyTarget = "verify_image.service";
using namespace phosphor::logging;
@@ -188,7 +195,15 @@
bool FlashUpdate::startDataVerification()
{
- /* TODO: implement. */
+ /* TODO: Look for injection point to test this. */
+ auto bus = sdbusplus::bus::new_default();
+
+ auto method = bus.new_method_call(systemdService, systemdRoot,
+ systemdInterface, "StartUnit");
+ method.append(verifyTarget);
+ method.append("replace");
+ bus.call_noreply(method);
+
return false;
}