Add the BIOSPostCode events into the BMCWeb EventService
- Add BIOSPostCode events to the bmcweb redfish event log, so that
users can collect BIOSPOSTCode events through redfish EventService.
Refer to:
https://github.com/openbmc/docs/blob/master/architecture/redfish-logging-in-bmcweb.md
- Add CMake option to trun on/off the log of post code.
The default setting is off.
Tested:
- Tested build OK.
- Check /var/log/redfish OK.
1970-01-01T00:05:06.042545+00:00 OpenBMC.0.1.BIOSPOSTCode,1,267.5030,0x15
1970-01-01T00:05:06.182087+00:00 OpenBMC.0.1.BIOSPOSTCode,1,267.5813,0x7f
1970-01-01T00:05:06.276475+00:00 OpenBMC.0.1.BIOSPOSTCode,1,267.7245,0x00
Signed-off-by: Alan Kuo <Alan_Kuo@quantatw.com>
Change-Id: Ieff2acd81ee6fbd74ad8005680499e6753860037
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cce209..7c68a66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
project(post-code-manager CXX)
+option (
+ ENABLE_BIOS_POST_CODE_LOG
+ "Enable Bios Post Code Logging"
+ OFF
+)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -43,4 +48,7 @@
target_link_libraries(${PROJECT_NAME} "${SDBUSPLUSPLUS_LIBRARIES} -lstdc++fs -lphosphor_dbus")
install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+target_compile_definitions (
+ ${PROJECT_NAME} PRIVATE $<$<BOOL:${ENABLE_BIOS_POST_CODE_LOG}>: -DENABLE_BIOS_POST_CODE_LOG>
+)
install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)