meta-ampere: support Redfish event log
Enable system event log for Redfish. It includes the setting to:
- Enable sel-logger module which logs the sensor event into the
systemd log.
- Enable the rsyslog (intel module) to sync the sensor events from
systemd to /var/log/redfish. The file will be used by Redfish.
- Configure the backend and redfish to get the system log from the
/var/log/redfish instead of system d-bus
- Enable Redfish journal log
Tested: Verify event logs appear in:
1. Redfish: /redfish/v1/Systems/system/LogServices/EventLog/Entries
2. Redfish: /redfish/v1/Managers/bmc/LogServices/Journal/Entries
3. WebUI: /server-health/sys-log at Event type.
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: I3753e2932ec1dc83cdbe0708173531930df65254
diff --git a/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend b/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
new file mode 100644
index 0000000..f667fb6
--- /dev/null
+++ b/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
@@ -0,0 +1,24 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://rsyslog.conf \
+ file://rsyslog.logrotate \
+ file://rotate-event-logs.service \
+ file://rotate-event-logs.sh \
+ file://rsyslog-override.conf \
+ "
+
+FILES_${PN} += "${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf"
+
+PACKAGECONFIG_append = " imjournal"
+
+do_install_append() {
+ install -m 0644 ${WORKDIR}/rotate-event-logs.service ${D}${systemd_system_unitdir}
+ install -d ${D}${systemd_system_unitdir}/rsyslog.service.d
+ install -m 0644 ${WORKDIR}/rsyslog-override.conf \
+ ${D}${systemd_system_unitdir}/rsyslog.service.d/rsyslog-override.conf
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/rotate-event-logs.sh ${D}/${bindir}/rotate-event-logs.sh
+ rm ${D}${sysconfdir}/rsyslog.d/imjournal.conf
+}
+
+SYSTEMD_SERVICE_${PN} += " rotate-event-logs.service"