Add SEL Logger Daemon
This change adds a SEL Logger daemon that handles all requests
to add new IPMI SEL records to the journal with the correct
metadata.
The expected metadata for a SEL record are
MESSAGE_ID = Used to identify SEL journal records, the SEL
MESSAGE_ID is b370836ccf2f4850ac5bee185b77893a
IPMI_SEL_RECORD_ID = Two byte unique SEL Record ID
IPMI_SEL_RECORD_TYPE = The type of SEL entry (system or OEM)
which determines the definition of the
remaining bytes
IPMI_SEL_GENERATOR_ID = The IPMI Generator ID (usually the
IPMB Slave Address) of the requester
IPMI_SEL_SENSOR_PATH = D-Bus path of the sensor in the event
IPMI_SEL_EVENT_DIR = Direction of the event (assert or deassert)
IPMI_SEL_DATA = Raw binary data included in the SEL record
It exposes an interface for manually adding System and OEM type SEL
events, and provides the capability to monitor for types of events
and log them automatically.
The interface for System type events requires a text message for the
journal entry, the sensor path, up to three bytes of SEL data, the
direction of the event, and the generator ID of the requester.
The interface for OEM type events requires a text message for the
journal entry, up to thirteen bytes of SEL data (depending on the
record type), and the record type.
The MESSAGE_ID and IPMI_SEL_RECORD_ID metadata are added by the
daemon.
Change-Id: Ib28af2e167826aaa39c0ad14ea1b2f03f51194bc
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..6569709
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required (VERSION 3.6)
+project (sel-logger CXX)
+set (CMAKE_CXX_STANDARD 17)
+set (CMAKE_CXX_STANDARD_REQUIRED ON)
+
+add_executable (sel-logger src/sel_logger.cpp)
+
+option (
+ SEL_LOGGER_MONITOR_THRESHOLD_EVENTS
+ "Enable SEL Logger to monitor and automatically
+ log SEL records for threshold sensor events"
+ OFF
+)
+target_compile_definitions (
+ sel-logger PRIVATE
+ $<$<BOOL:${SEL_LOGGER_MONITOR_THRESHOLD_EVENTS}>: -DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS>
+)
+
+target_include_directories (sel-logger PRIVATE ${CMAKE_SOURCE_DIR})
+
+target_link_libraries (sel-logger systemd sdbusplus pthread phosphor_logging)
+
+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+install (TARGETS sel-logger
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib/static)
+
+find_package (Boost 1.66 REQUIRED)
+include_directories (${BOOST_SRC_DIR})
+
+add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
+add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
+add_definitions (-DBOOST_ALL_NO_LIB)
+add_definitions (-DBOOST_NO_RTTI)
+add_definitions (-DBOOST_NO_TYPEID)
+
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
+
+set (
+ SERVICE_FILES
+ ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.Logging.IPMI.service
+)
+install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)