dreport: Added GUARD plugin

Plugin used for collecting GUARD record information.

GUARD records provides failed hardware FRU information in the system.
This will be usefull for debugging field issues related to
hardware failures.

Resolves openbmc/openbmc#199

abandoned commit which was in meta-ibm
https://gerrit.openbmc-project.xyz/c/openbmc/meta-ibm/+/14592

Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Change-Id: Ibbf6fd630b8b8c45952dffbe89bf97d781bfbef2
diff --git a/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend b/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend
new file mode 100644
index 0000000..a4cb739
--- /dev/null
+++ b/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend
@@ -0,0 +1,18 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI += "file://plugins.d/guard"
+
+install_openpower_plugins() {
+    install -m 0755 ${WORKDIR}/plugins.d/guard ${D}${dreport_plugin_dir}
+}
+
+#Link in the plugins so dreport run them at the appropriate time
+python link_openpower_plugins() {
+    workdir = d.getVar('WORKDIR', True)
+    script = os.path.join(workdir, 'plugins.d', 'guard')
+    install_dreport_user_script(script, d)
+}
+
+DEBUG_COLLECTOR_INSTALL_POSTFUNCS ?= ""
+DEBUG_COLLECTOR_INSTALL_POSTFUNCS_df-openpower ?= "install_openpower_plugins link_openpower_plugins"
+
+do_install[postfuncs] += "${DEBUG_COLLECTOR_INSTALL_POSTFUNCS}"