mpreboot: utilize new distro feature for checks

Previous code was piggy backing the memory preserving reboot function
off of the phal machine feature. This had issues in that a
witherspoon-tacoma system also supports mpreboot, but does not support
phal.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ib044f5252843e84be3304bc0df8ffb8aa947526c
diff --git a/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb b/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb
index cae79be..7ce65f9 100644
--- a/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb
+++ b/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb
@@ -57,8 +57,11 @@
 		LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
 		TARGET="../proc-pre-poweroff@.service"
 		ln -s $TARGET $LINK
+    fi
 
-		# on phal systems, obmc-host-crash@.target is used for MPIPL
+	# If the memory preserving reboot feature is enabled, set it up
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
+		# on mpreboot systems, obmc-host-crash@.target is used for mpreboot
 		mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires
 		LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
 		TARGET="../obmc-host-force-warm-reboot@.target"
@@ -68,12 +71,12 @@
 		TARGET="../op-enter-mpreboot@.service"
 		ln -s $TARGET $LINK
 
-		# ensure diagnostic mode is shown for MPIPL
+		# ensure diagnostic mode is shown for MPREBOOT
 		LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target"
 		TARGET="../obmc-host-diagnostic-mode@.target"
 		ln -s $TARGET $LINK
 	else
-		# If not phal, default to quiesce target in crash target to support
+		# If not a mpreboot system, default to quiesce target in crash target to support
 		# older system designs like witherspoon
 		mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
 		LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
@@ -104,7 +107,10 @@
 
 		LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
 		rm $LINK
+	fi
 
+	# Remove mpreboot specific units if enabled
+	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
 		LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
 		rm $LINK