Add rsyslog configuration for Redfish Log and IPMI SEL

Persisting the journal to flash introduced some significant
issues, so this uses an rsyslog configuration to extract any
IPMI SEL and Redfish events from the journal and persist them
to flash in a text file.

This allows many more events to be stored without any adverse
issues in system behavior.

Tested:
Used IPMI and Redfish to retrieve logs before and after a BMC
reboot and confirmed that they are correctly persisted.

(From meta-intel rev: 176b19e807890f6014157d7b1b705e96c0fc4878)

Change-Id: I02fac9af333d854204d41e238ae598bad7782328
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-intel/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend b/meta-intel/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
new file mode 100644
index 0000000..7e28280
--- /dev/null
+++ b/meta-intel/meta-common/recipes-extended/rsyslog/rsyslog_%.bbappend
@@ -0,0 +1,23 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://rsyslog.conf \
+           file://rsyslog.logrotate \
+           file://rotate-event-logs.service \
+           file://rotate-event-logs.timer \
+           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 -m 0644 ${WORKDIR}/rotate-event-logs.timer ${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
+        rm ${D}${sysconfdir}/rsyslog.d/imjournal.conf
+}
+
+SYSTEMD_SERVICE_${PN} += " rotate-event-logs.service rotate-event-logs.timer"