Add recipe for Phosphor Debug collector

Resolves openbmc/openbmc#1503

Change-Id: Id42d8c5042af4a9a74a9a284f3601989a65c5054
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/classes/obmc-phosphor-image.bbclass b/classes/obmc-phosphor-image.bbclass
index 29689b7..d6d91ff 100644
--- a/classes/obmc-phosphor-image.bbclass
+++ b/classes/obmc-phosphor-image.bbclass
@@ -21,6 +21,7 @@
 # - obmc-software                     - OpenBMC software management
 # - obmc-system-mgmt                  - OpenBMC system management
 # - obmc-user-mgmt                    - OpenBMC user management
+# - obmc-debug-collector              - OpenBMC debug collector
 
 inherit core-image
 inherit obmc-phosphor-license
@@ -50,6 +51,7 @@
 FEATURE_PACKAGES_obmc-software ?= "packagegroup-obmc-apps-software"
 FEATURE_PACKAGES_obmc-system-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-system-mgmt', 'virtual-obmc-system-mgmt')}"
 FEATURE_PACKAGES_obmc-user-mgmt ?= "${@df_enabled(d, 'obmc-phosphor-user-mgmt', 'virtual-obmc-user-mgmt')}"
+FEATURE_PACKAGES_obmc-debug-collector ?= "${@df_enabled(d, 'obmc-debug-collector', 'virtual-obmc-debug-collector')}"
 
 # Install entire Phosphor application stack by default
 IMAGE_FEATURES += " \
@@ -74,6 +76,7 @@
         obmc-system-mgmt \
         obmc-user-mgmt \
         ssh-server-dropbear \
+        obmc-debug-collector \
         "
 
 CORE_IMAGE_EXTRA_INSTALL_append = " bash \
diff --git a/common/recipes-phosphor/dump/phosphor-debug-collector.bb b/common/recipes-phosphor/dump/phosphor-debug-collector.bb
new file mode 100644
index 0000000..0c0c125
--- /dev/null
+++ b/common/recipes-phosphor/dump/phosphor-debug-collector.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Phosphor Debug Collector"
+DESCRIPTION = "Phosphor Debug Collector provides mechanisms \
+to collect various FFDC files and system parameters. \
+This will be helpful for troubleshooting the problems in OpenBMC \
+based systems."
+
+PR = "r1"
+
+inherit autotools \
+        pkgconfig \
+        obmc-phosphor-dbus-service
+
+require phosphor-debug-collector.inc
+
+DEPENDS += " \
+        phosphor-dbus-interfaces \
+        phosphor-dbus-interfaces-native \
+        phosphor-logging \
+        sdbusplus \
+        sdbusplus-native \
+        autoconf-archive-native \
+        "
+
+RDEPENDS_${PN} += " \
+        sdbusplus \
+        phosphor-dbus-interfaces \
+        phosphor-logging \
+        "
+
+DBUS_SERVICE_${PN} += "xyz.openbmc_project.Dump.service"
+
+S = "${WORKDIR}/git"
diff --git a/common/recipes-phosphor/dump/phosphor-debug-collector.inc b/common/recipes-phosphor/dump/phosphor-debug-collector.inc
new file mode 100644
index 0000000..0a983bd
--- /dev/null
+++ b/common/recipes-phosphor/dump/phosphor-debug-collector.inc
@@ -0,0 +1,5 @@
+HOMEPAGE = "https://github.com/openbmc/phosphor-debug-collector"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+SRC_URI += "git://github.com/openbmc/phosphor-debug-collector"
+SRCREV = "224882b0a744bbee8b1a8229f54a854cac4aea30"
diff --git a/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.service b/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.service
new file mode 100644
index 0000000..9aeba93
--- /dev/null
+++ b/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Phosphor Dump Manager
+
+[Service]
+ExecStart={sbindir}/phosphor-dump-manager
+Restart=always
+Type=dbus
+BusName={BUSNAME}
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
index f3212cd..4c116ff 100644
--- a/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
+++ b/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
@@ -18,6 +18,7 @@
         ${PN}-sensors \
         ${PN}-software \
         ${PN}-host-check-mgmt \
+        ${PN}-debug-collector \
         "
 
 SUMMARY_${PN}-bmc-state-mgmt = "BMC state management"
@@ -82,3 +83,6 @@
         ${VIRTUAL-RUNTIME_obmc-bmc-code-mgr} \
         ${VIRTUAL-RUNTIME_obmc-bmc-download-mgr} \
         "
+SUMMARY_${PN}-debug-collector = "BMC debug collector"
+RDEPENDS_${PN}-debug-collector = " \
+        ${VIRTUAL-RUNTIME_obmc-debug-collector} \
diff --git a/conf/distro/include/phosphor-defaults.inc b/conf/distro/include/phosphor-defaults.inc
index 8ce8e4b..a4415be 100644
--- a/conf/distro/include/phosphor-defaults.inc
+++ b/conf/distro/include/phosphor-defaults.inc
@@ -94,6 +94,10 @@
 # for hwmon sensors.
 VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "phosphor-hwmon"
 
+# obmc-debug-collector
+# The phosphor-dump-manager application used for collecting and managing Dumps
+VIRTUAL-RUNTIME_obmc-debug-collector ?= "phosphor-dump-manager"
+
 PREFERRED_PROVIDER_virtual/obmc-settings-mgmt ?= "phosphor-settings"
 PREFERRED_PROVIDER_virtual/obmc-system-mgmt ?= "obmc-phosphor-sysd"
 PREFERRED_PROVIDER_virtual/obmc-user-mgmt ?= "obmc-phosphor-user"