Create initial skeleton of host check code
This sequence of commits will be the application
that runs after a BMC reset when it's detected that
pgood is on. This applications job is to check
whether the host is running, and if it is, to
create a specific file in the filesystem that
will prevent the host power on targets services
from executing.
Change-Id: If5d26a443a0d8fd1873df166a6a5d45290eb6401
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 64b1b82..f15d970 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,8 @@
phosphor-host-state-manager \
phosphor-chassis-state-manager \
phosphor-bmc-state-manager \
- phosphor-discover-system-state
+ phosphor-discover-system-state \
+ phosphor-host-check
phosphor_host_state_manager_SOURCES = \
host_state_manager.cpp \
@@ -21,6 +22,9 @@
phosphor_discover_system_state_SOURCES = \
discover_system_state.cpp
+phosphor_host_check_SOURCES = \
+ host_check_main.cpp
+
generic_cxxflags = $(SYSTEMD_CFLAGS) $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) $(SDBUSPLUS_CFLAGS)
generic_ldflags = $(SYSTEMD_LIBS) $(PHOSPHOR_DBUS_INTERFACES_LIBS) $(SDBUSPLUS_LIBS)
@@ -35,3 +39,6 @@
phosphor_discover_system_state_CXXFLAGS = $(generic_cxxflags)
phosphor_discover_system_state_LDFLAGS = $(generic_ldflags)
+
+phosphor_host_check_CXXFLAGS = $(generic_cxxflags)
+phosphor_host_check_LDFLAGS = $(generic_ldflags)
diff --git a/host_check_main.cpp b/host_check_main.cpp
new file mode 100644
index 0000000..6dab9cb
--- /dev/null
+++ b/host_check_main.cpp
@@ -0,0 +1,20 @@
+#include <cstdlib>
+#include <sdbusplus/bus.hpp>
+#include <phosphor-logging/log.hpp>
+
+using namespace phosphor::logging;
+
+int main(int argc, char *argv[])
+{
+ log<level::INFO>("Check if host is running");
+
+ // Setup Signal Handler
+
+ // Initiate heartbeat command
+
+ // Wait for signal
+
+ // If host running then create file
+
+ return 0;
+}