phosphor-state-manager: reorder prerm functions

The previous order of all `postinst` functions followed by `prerm`
functions made it easy to miss making a change in the `prerm` due
to their large distances from each other in the file.  Reorder these
so that they are grouped by subpackages rather than function type.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib2be0617f4e1f805ed611688d77bb4d278abbd94
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
index 52bbb05..df21431 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc
@@ -24,7 +24,6 @@
 #       currently that there is a 1-to-1 relationship between the two.
 
 pkg_postinst:${PN}-obmc-targets:append() {
-
     for i in ${OBMC_HOST_INSTANCES};
     do
         for j in ${DEFAULT_TARGETS};
@@ -38,43 +37,7 @@
     done
 }
 
-pkg_postinst:${PN}-chassis:append() {
-    for i in ${OBMC_CHASSIS_INSTANCES};
-    do
-        mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
-
-        LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Chassis@${i}.service"
-        TARGET="../xyz.openbmc_project.State.Chassis@.service"
-        ln -s $TARGET $LINK
-
-    done
-}
-
-pkg_postinst:${PN}-chassis-check-power-status:append() {
-
-    for i in ${OBMC_HOST_INSTANCES};
-    do
-        mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires
-        LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service"
-        TARGET="../phosphor-chassis-check-power-status@.service"
-        ln -s $TARGET $LINK
-    done
-}
-
-pkg_postinst:${PN}-host:append() {
-    for i in ${OBMC_HOST_INSTANCES};
-    do
-        mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
-
-        LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service"
-        TARGET="../xyz.openbmc_project.State.Host@.service"
-        ln -s $TARGET $LINK
-
-    done
-}
-
 pkg_prerm:${PN}-obmc-targets:append() {
-
     for i in ${OBMC_HOST_INSTANCES};
     do
         for j in ${DEFAULT_TARGETS};
@@ -86,33 +49,56 @@
     done
 }
 
+pkg_postinst:${PN}-chassis:append() {
+    for i in ${OBMC_CHASSIS_INSTANCES};
+    do
+        mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
+        LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Chassis@${i}.service"
+        TARGET="../xyz.openbmc_project.State.Chassis@.service"
+        ln -s $TARGET $LINK
+    done
+}
+
 pkg_prerm:${PN}-chassis:append() {
     for i in ${OBMC_CHASSIS_INSTANCES};
     do
-
         LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Chassis@${i}.service"
         rm $LINK
+    done
+}
 
+pkg_postinst:${PN}-chassis-check-power-status:append() {
+    for i in ${OBMC_HOST_INSTANCES};
+    do
+        mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires
+        LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service"
+        TARGET="../phosphor-chassis-check-power-status@.service"
+        ln -s $TARGET $LINK
     done
 }
 
 pkg_prerm:${PN}-chassis-check-power-status:append() {
-
     for i in ${OBMC_HOST_INSTANCES};
     do
-
         LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service"
         rm $LINK
+    done
+}
 
+pkg_postinst:${PN}-host:append() {
+    for i in ${OBMC_HOST_INSTANCES};
+    do
+        mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
+        LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service"
+        TARGET="../xyz.openbmc_project.State.Host@.service"
+        ln -s $TARGET $LINK
     done
 }
 
 pkg_prerm:${PN}-host:append() {
     for i in ${OBMC_HOST_INSTANCES};
     do
-
         LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service"
         rm $LINK
-
     done
 }