Prevent duplicate kernel message in journal

OpenBMC uses busybox which uses klogd which causes duplicate
kernel messages to show up in the journal due to syslog.
This override prevents journald from reading from kmsg so
only one instance of the kernel messages will show up in
journald instead of the two of each currently put in the
journal

Tested: Verified only one instance of kernel messages were
in the journal.

Resolves openbmc/openbmc#2720

Change-Id: I434f48159990e7b068103e5c11ac3c9431112199
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb b/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb
index 34abf50..ce58a53 100644
--- a/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb
+++ b/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb
@@ -8,8 +8,13 @@
 DEPENDS += "systemd"
 
 SRC_URI = "file://service-restart-policy.conf"
+SRC_URI += "file://disable-duplicate-kernel-msg.conf"
+
 FILES_${PN} += "${systemd_unitdir}/system.conf.d/service-restart-policy.conf"
+FILES_${PN} += "${systemd_unitdir}/journald.conf.d/disable-duplicate-kernel-msg.conf"
+
 
 do_install() {
         install -m 644 -D ${WORKDIR}/service-restart-policy.conf ${D}${systemd_unitdir}/system.conf.d/service-restart-policy.conf
+        install -m 644 -D ${WORKDIR}/disable-duplicate-kernel-msg.conf ${D}${systemd_unitdir}/journald.conf.d/disable-duplicate-kernel-msg.conf
 }
diff --git a/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf b/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf
new file mode 100644
index 0000000..beb2f44
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf
@@ -0,0 +1,13 @@
+# This file overrides some defaults for systemd
+#
+# OpenBMC uses busybox which uses klogd which causes duplicate
+# kernel messages to show up in the journal due to syslog.
+# This override prevents journald from reading from kmsg so
+# only one instance of the kernel messages will show up in
+# journald instead of the two of each currently put in the
+# journal
+#
+# See systemd-system.conf(5) for details on the conf files
+
+[Journal]
+ReadKMsg=no