mpreboot: do not install service if mpreboot enabled

When mpreboot is enabled, there is a more advanced form of diagnostic
and recovery put into the obmc-host-crash@.target. In this case we do
not want the basic error reported by the service within this repo.

Tested:
- Verified correct services installed for mpreboot on Rainier and
  Tacoma machines
- Verified non-mpreboot services installed on Witherspoon machine

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: If29ad7a83c1e1551a7eb319179eca504e9f93678
diff --git a/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc b/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc
index 7b2bb59..a3b729e 100644
--- a/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc
+++ b/meta-openpower/recipes-phosphor/debug/openpower-debug-collector-systemd-links.inc
@@ -2,9 +2,14 @@
 	mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
 	mkdir -p $D$systemd_system_unitdir/obmc-host-timeout@0.target.wants
 
-	LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service"
-	TARGET="../openpower-debug-collector-checkstop@.service"
-	ln -s $TARGET $LINK
+	# The obmc-host-crash target is repurposed for the memory preserving reboot
+	# feature when it is enabled. If not enabled, then install the standard
+	# debug collector checkstop service for basic error reporting
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" != mpreboot ]; then
+		LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service"
+		TARGET="../openpower-debug-collector-checkstop@.service"
+		ln -s $TARGET $LINK
+	fi
 
 	LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog@0.service"
 	TARGET="../openpower-debug-collector-watchdog@.service"
@@ -16,8 +21,10 @@
 }
 
 pkg_prerm_${PN}_append() {
-	LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service"
-	rm $LINK
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" != mpreboot ]; then
+		LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service"
+		rm $LINK
+	fi
 	LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog@0.service"
 	rm $LINK
 	LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog-timeout@0.service"