Create a new package for the phosphor-dump-monitor.

Change-Id: I7f61a48b31d2997c1710c7d0bdde387e5c41a598
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass
index cfb64bd..3766c73 100644
--- a/meta-phosphor/classes/obmc-phosphor-image.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass
@@ -49,7 +49,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')}"
+FEATURE_PACKAGES_obmc-debug-collector ?= "packagegroup-obmc-apps-debug-collector"
 
 # Install entire Phosphor application stack by default
 IMAGE_FEATURES += " \
diff --git a/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb
index 8337c1d..56e80ee 100644
--- a/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb
+++ b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb
@@ -6,6 +6,19 @@
 
 PR = "r1"
 
+DEBUG_COLLECTOR_PKGS = " \
+    ${PN}-manager \
+    ${PN}-monitor \
+"
+PACKAGES =+ "${DEBUG_COLLECTOR_PKGS}"
+PACKAGES_remove = "${PN}"
+RDEPENDS_${PN}-dev = "${DEBUG_COLLECTOR_PKGS}"
+RDEPENDS_${PN}-staticdev = "${DEBUG_COLLECTOR_PKGS}"
+
+DBUS_PACKAGES = "${PN}-manager"
+
+SYSTEMD_PACKAGES = "${PN}-monitor"
+
 inherit autotools \
         pkgconfig \
         obmc-phosphor-dbus-service \
@@ -20,14 +33,23 @@
         sdbusplus \
         sdbusplus-native \
         autoconf-archive-native \
-        "
+"
 
-RDEPENDS_${PN} += " \
+RDEPENDS_${PN}-manager += " \
         sdbusplus \
         phosphor-dbus-interfaces \
         phosphor-logging \
-        "
+"
+RDEPENDS_${PN}-monitor += " \
+        sdbusplus \
+        phosphor-dbus-interfaces \
+        phosphor-logging \
+"
 
-DBUS_SERVICE_${PN} += "xyz.openbmc_project.Dump.service"
+FILES_${PN}-manager += "${sbindir}/phosphor-dump-manager"
+FILES_${PN}-monitor += "${sbindir}/phosphor-dump-monitor"
+
+DBUS_SERVICE_${PN}-manager += "xyz.openbmc_project.Dump.Manager.service"
+SYSTEMD_SERVICE_${PN}-monitor += "obmc-dump-monitor.service"
 
 S = "${WORKDIR}/git"
diff --git a/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/obmc-dump-monitor.service b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/obmc-dump-monitor.service
new file mode 100644
index 0000000..b6e75f1
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/obmc-dump-monitor.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Phosphor Dump core monitor.
+
+[Service]
+ExecStart={sbindir}/phosphor-dump-monitor
+Restart=always
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.service b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.Manager.service
similarity index 100%
rename from meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.service
rename to meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.Manager.service
diff --git a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
index fae6077..a500bf3 100644
--- a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
+++ b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
@@ -89,7 +89,8 @@
         "
 SUMMARY_${PN}-debug-collector = "BMC debug collector"
 RDEPENDS_${PN}-debug-collector = " \
-        ${VIRTUAL-RUNTIME_obmc-debug-collector} \
+        ${VIRTUAL-RUNTIME_obmc-dump-manager} \
+        ${VIRTUAL-RUNTIME_obmc-dump-monitor} \
         "
 
 SUMMARY_${PN}-settings = "Settings applications"
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index d512e7d..e7e4823 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -104,9 +104,13 @@
 # for hwmon sensors.
 VIRTUAL-RUNTIME_obmc-sensors-hwmon ?= "phosphor-hwmon"
 
-# obmc-debug-collector
-# The phosphor-debug-collector used for collecting and managing dumps
-VIRTUAL-RUNTIME_obmc-debug-collector ?= "phosphor-debug-collector"
+# obmc-dump-manager
+# Provide support for managing dump
+VIRTUAL-RUNTIME_obmc-dump-manager ?= "phosphor-debug-collector-manager"
+
+# obmc-dump-monitor
+# Provide support for monitoring BMC core dumps
+VIRTUAL-RUNTIME_obmc-dump-monitor ?= "phosphor-debug-collector-monitor"
 
 PREFERRED_PROVIDER_virtual/obmc-settings-mgmt ?= "phosphor-settings"
 PREFERRED_PROVIDER_virtual/obmc-system-mgmt ?= "obmc-phosphor-sysd"