Run oe-stylize on our files

In all of our recipes, we should be following yoctos lead on formatting,
order, and other things, for consistency in our meta layers.

This commit runs oe-stylize.py on all of our files.  The types of
changes being made can be seen in the commit, but amount to:

1. Setting an explicit key ordering
2. Sectioning the files appropriately
3. Applying rules checking to our files

At some point in the near future, we would turn this on as part of
repotest, but some minor changes need to be upstreamed to meta-oe (WIP)
to make that happen.

Looking for input on whether this is something we'd like to do, and
whether the diffs below look reasonable to folks.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I489dd21d38a9fe4f3ece89cc7a5e1d0463224abf
diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan_git.bb b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan_git.bb
index a138f7a..7689fa6 100644
--- a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan_git.bb
+++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan_git.bb
@@ -1,15 +1,14 @@
 SUMMARY = "OpenBMC fan control"
 DESCRIPTION = "OpenBMC fan control."
-PR = "r1"
+DEPENDS = "systemd"
 PV = "1.0+git${SRCPV}"
+PR = "r1"
+
+SKELETON_DIR = "fanctl"
+SYSTEMD_SERVICE:${PN} += "obmc-max-fans.service"
 
 inherit skeleton-sdbus
 inherit obmc-phosphor-dbus-service
 inherit pkgconfig
 
-DEPENDS = "systemd"
-
-SKELETON_DIR = "fanctl"
-
 DBUS_SERVICE:${PN} += "org.openbmc.control.Fans.service"
-SYSTEMD_SERVICE:${PN} += "obmc-max-fans.service"
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config.bb
index 7d9fbde..cda3f5d 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config.bb
@@ -1,14 +1,14 @@
 SUMMARY = "Phosphor zone events definition default data"
-PR = "r1"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+PR = "r1"
 
-inherit allarch
-inherit phosphor-fan
+SRC_URI = "file://events.yaml"
 
 S = "${WORKDIR}"
 
-SRC_URI = "file://events.yaml"
+inherit allarch
+inherit phosphor-fan
 
 do_install() {
     install -D events.yaml ${D}${control_datadir}/events.yaml
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw.bb
index 428c212..0f8f643 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw.bb
@@ -1,22 +1,21 @@
 SUMMARY = "Generate fan control YAML from the MRW"
-PR = "r1"
 LICENSE = "Apache-2.0"
+DEPENDS = "mrw-native mrw-perl-tools-native"
+PROVIDES += "virtual/phosphor-fan-control-fan-config"
+PR = "r1"
+
+S = "${WORKDIR}"
 
 inherit allarch
 inherit phosphor-fan
 inherit mrw-xml
 
-S = "${WORKDIR}"
-DEPENDS = "mrw-native mrw-perl-tools-native"
-PROVIDES += "virtual/phosphor-fan-control-fan-config"
-
 do_compile() {
     ${bindir}/perl-native/perl \
         ${bindir}/gen_fan_zone_yaml.pl \
         -i ${STAGING_DIR_NATIVE}${mrw_datadir}/${MRW_XML} \
         -o fans.yaml
 }
-
 do_install() {
         install -D fans.yaml ${D}${control_datadir}/fans.yaml
 }
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config.bb
index 54e6045..b6bf189 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config.bb
@@ -1,16 +1,16 @@
 SUMMARY = "Phosphor fan definition example data"
-PR = "r1"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+PROVIDES += "virtual/phosphor-fan-control-fan-config"
+PR = "r1"
+
+SRC_URI = "file://fans.yaml"
+
+S = "${WORKDIR}"
 
 inherit allarch
 inherit phosphor-fan
 
-S = "${WORKDIR}"
-PROVIDES += "virtual/phosphor-fan-control-fan-config"
-
-SRC_URI = "file://fans.yaml"
-
 do_install() {
     install -D fans.yaml ${D}${control_datadir}/fans.yaml
 }
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config.bb
index 8d040e1..f924ffa 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config.bb
@@ -1,14 +1,14 @@
 SUMMARY = "Phosphor zone conditions definition default data"
-PR = "r1"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+PR = "r1"
 
-inherit allarch
-inherit phosphor-fan
+SRC_URI = "file://zone_conditions.yaml"
 
 S = "${WORKDIR}"
 
-SRC_URI = "file://zone_conditions.yaml"
+inherit allarch
+inherit phosphor-fan
 
 do_install() {
     install -D zone_conditions.yaml ${D}${control_datadir}/zone_conditions.yaml
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config.bb
index e2136f7..ee1056a 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config.bb
@@ -1,14 +1,14 @@
 SUMMARY = "Phosphor fan zone definition default data"
-PR = "r1"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+PR = "r1"
 
-inherit allarch
-inherit phosphor-fan
+SRC_URI = "file://zones.yaml"
 
 S = "${WORKDIR}"
 
-SRC_URI = "file://zones.yaml"
+inherit allarch
+inherit phosphor-fan
 
 do_install() {
     install -D zones.yaml ${D}${control_datadir}/zones.yaml
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config.bb
index d49bda4..61764d5 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config.bb
@@ -1,14 +1,14 @@
 SUMMARY = "Phosphor fan monitor definition default data"
-PR = "r1"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+PR = "r1"
 
-inherit allarch
-inherit phosphor-fan
+SRC_URI = "file://monitor.yaml"
 
 S = "${WORKDIR}"
 
-SRC_URI = "file://monitor.yaml"
+inherit allarch
+inherit phosphor-fan
 
 do_install() {
     DEST=${D}${monitor_datadir}
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config.bb
index d2df636..d1deb86 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config.bb
@@ -3,20 +3,19 @@
 # append this recipe in a layer, add:
 # FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
 # and provide a config file.
-
 SUMMARY = "Config file for phosphor-fan-presence"
-PR = "r1"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+PROVIDES += "virtual/phosphor-fan-presence-config"
+PR = "r1"
+
+SRC_URI = "file://config.yaml"
+
+S = "${WORKDIR}"
 
 inherit allarch
 inherit phosphor-fan
 
-S = "${WORKDIR}"
-PROVIDES += "virtual/phosphor-fan-presence-config"
-
-SRC_URI = "file://config.yaml"
-
 do_install() {
         install -D config.yaml ${D}${presence_datadir}/config.yaml
 }
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw.bb
index aa0e807..84e4bf1 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw.bb
@@ -1,24 +1,22 @@
 SUMMARY = "Generate fan presence YAML from the MRW"
-PR = "r1"
 LICENSE = "Apache-2.0"
+DEPENDS = "mrw-native mrw-perl-tools-native"
+PROVIDES += "virtual/phosphor-fan-presence-config"
+PR = "r1"
+
+S = "${WORKDIR}"
 
 inherit allarch
 inherit phosphor-fan
 inherit mrw-xml
 
-DEPENDS = "mrw-native mrw-perl-tools-native"
-PROVIDES += "virtual/phosphor-fan-presence-config"
-
-FILES:${PN} += "${presence_datadir}/config.yaml"
-
-S = "${WORKDIR}"
-
 do_install() {
         DEST=${D}${presence_datadir}
         install -d ${DEST}
-
         ${bindir}/perl-native/perl \
             ${bindir}/gen_presence_yaml.pl \
             -i ${STAGING_DIR_NATIVE}${mrw_datadir}/${MRW_XML} \
             -o ${DEST}/config.yaml
 }
+
+FILES:${PN} += "${presence_datadir}/config.yaml"
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb
index da2d695..a8eecf8 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb
@@ -1,16 +1,6 @@
 SUMMARY = "Phosphor Fan"
 DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \
 control applications."
-PR = "r1"
-PV = "1.0+git${SRCPV}"
-
-require ${BPN}.inc
-inherit meson pkgconfig python3native
-inherit obmc-phosphor-systemd
-inherit phosphor-fan
-
-S = "${WORKDIR}/git"
-
 # Common build dependencies
 DEPENDS += "${PYTHON_PN}-pyyaml-native"
 DEPENDS += "${PYTHON_PN}-mako-native"
@@ -22,26 +12,9 @@
 DEPENDS += "libevdev"
 DEPENDS += "nlohmann-json"
 DEPENDS += "cli11"
-
-# Package configuration
-FAN_PACKAGES = " \
-        ${PN}-presence-tach \
-        ${PN}-control \
-        ${PN}-monitor \
-        ${PN}-sensor-monitor \
-"
-
-ALLOW_EMPTY:${PN} = "1"
-PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
 PACKAGECONFIG ?= "presence control monitor sensor-monitor"
-SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
-EXTRA_OEMESON:append = " -Dtests=disabled"
-PKG_DEFAULT_MACHINE ??= "${MACHINE}"
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
 # The control, monitor, and presence apps can either be JSON or YAML driven.
 PACKAGECONFIG[json] = "-Djson-config=enabled, -Djson-config=disabled"
-
 # --------------------------------------
 # ${PN}-presence-tach specific configuration
 PACKAGECONFIG[presence] = "-Dpresence-service=enabled \
@@ -51,26 +24,6 @@
     virtual/phosphor-fan-presence-config \
     , \
 "
-
-MULTI_USR_TGT = "multi-user.target"
-TMPL_TACH = "phosphor-fan-presence-tach@.service"
-INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
-POWERON_TGT = "obmc-chassis-poweron@{0}.target"
-FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.wants/${INSTFMT_TACH}"
-FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}"
-
-FILES:${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
-SYSTEMD_SERVICE:${PN}-presence-tach += "${TMPL_TACH}"
-SYSTEMD_LINK:${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
-
-# JSON mode also gets linked into multi-user
-SYSTEMD_LINK:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-        compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_INSTANCES'), '', d)}"
-
-# Package the JSON config files installed from the repo
-FILES:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-    '${datadir}/phosphor-fan-presence/presence/*', '', d)}"
-
 # --------------------------------------
 # ${PN}-control specific configuration
 PACKAGECONFIG[control] = "-Dcontrol-service=enabled \
@@ -86,37 +39,6 @@
     phosphor-fan-control-zone-conditions-config \
     , \
 "
-
-FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
-
-TMPL_CONTROL = "phosphor-fan-control@.service"
-INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
-FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
-FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
-FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.wants/${INSTFMT_CONTROL}"
-
-TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
-INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
-FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
-
-FILES:${PN}-control = "${bindir}/phosphor-fan-control"
-FILES:${PN}-control += "${bindir}/fanctl"
-SYSTEMD_SERVICE:${PN}-control += "${TMPL_CONTROL}"
-SYSTEMD_SERVICE:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}"
-
-# JSON: Linked to multi-user and poweron
-# YAML: Linked to fans-ready and fan control-init poweron
-SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-        compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
-        compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES'), d)}"
-SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-        compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES'), \
-        compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"
-
-# Package the JSON config files installed from the repo
-FILES:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-    '${datadir}/phosphor-fan-presence/control/*', '', d)}"
-
 # --------------------------------------
 # ${PN}-monitor specific configuration
 PACKAGECONFIG[monitor] = "-Dmonitor-service=enabled \
@@ -126,43 +48,102 @@
     phosphor-fan-monitor-config \
     , \
 "
-
-TMPL_MONITOR = "phosphor-fan-monitor@.service"
-INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
-FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
-FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.wants/${INSTFMT_MONITOR}"
-FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}"
-
-TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
-INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
-FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
-
-FILES:${PN}-monitor = "${bindir}/phosphor-fan-monitor"
-SYSTEMD_SERVICE:${PN}-monitor += "${TMPL_MONITOR}"
-SYSTEMD_SERVICE:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}"
-
-# JSON: power on and multi-user links.  YAML: fans-ready and fan monitor init links
-SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-                                compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_INSTANCES'), \
-                                compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_INSTANCES'), d)}"
-
-SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-                                compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
-                                compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"
-
-# Package the JSON config files installed from the repo
-FILES:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
-    '${datadir}/phosphor-fan-presence/monitor/*', '', d)}"
-
 # --------------------------------------
 # phosphor-cooling-type specific configuration
 PACKAGECONFIG[cooling-type] = "-Dcooling-type-service=enabled,-Dcooling-type-service=disabled,,"
 # --------------------------------------
 # ${PN}-sensor-monitor specific configuration
 PACKAGECONFIG[sensor-monitor] = "-Dsensor-monitor-service=enabled,-Dsensor-monitor-service=disabled"
+PV = "1.0+git${SRCPV}"
+PR = "r1"
 
-FAN_PACKAGES:append = "${@bb.utils.contains('PACKAGECONFIG', 'sensor-monitor', ' sensor-monitor', '', d)}"
-
-FILES:sensor-monitor += " ${bindir}/sensor-monitor"
+S = "${WORKDIR}/git"
+SYSTEMD_PACKAGES = "${FAN_PACKAGES}"
+SYSTEMD_SERVICE:${PN}-presence-tach += "${TMPL_TACH}"
+SYSTEMD_LINK:${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}"
+# JSON mode also gets linked into multi-user
+SYSTEMD_LINK:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+        compose_list(d, 'FMT_TACH_MUSR', 'OBMC_CHASSIS_INSTANCES'), '', d)}"
+SYSTEMD_SERVICE:${PN}-control += "${TMPL_CONTROL}"
+SYSTEMD_SERVICE:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}"
+# JSON: Linked to multi-user and poweron
+# YAML: Linked to fans-ready and fan control-init poweron
+SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+        compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
+        compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES'), d)}"
+SYSTEMD_LINK:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+        compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES'), \
+        compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"
+SYSTEMD_SERVICE:${PN}-monitor += "${TMPL_MONITOR}"
+SYSTEMD_SERVICE:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}"
+# JSON: power on and multi-user links.  YAML: fans-ready and fan monitor init links
+SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+                                compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_INSTANCES'), \
+                                compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_INSTANCES'), d)}"
+SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+                                compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
+                                compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"
 SYSTEMD_SERVICE:sensor-monitor += "sensor-monitor.service"
 SYSTEMD_LINK:sensor-monitor += "../sensor-monitor.service:${MULTI_USR_TGT}.wants/sensor-monitor.service"
+
+inherit meson pkgconfig python3native
+inherit obmc-phosphor-systemd
+inherit phosphor-fan
+
+EXTRA_OEMESON:append = " -Dtests=disabled"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES:${PN}-presence-tach = "${bindir}/phosphor-fan-presence-tach"
+# Package the JSON config files installed from the repo
+FILES:${PN}-presence-tach += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+    '${datadir}/phosphor-fan-presence/presence/*', '', d)}"
+FILES:${PN}-control = "${bindir}/phosphor-fan-control"
+FILES:${PN}-control += "${bindir}/fanctl"
+# Package the JSON config files installed from the repo
+FILES:${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+    '${datadir}/phosphor-fan-presence/control/*', '', d)}"
+FILES:${PN}-monitor = "${bindir}/phosphor-fan-monitor"
+# Package the JSON config files installed from the repo
+FILES:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
+    '${datadir}/phosphor-fan-presence/monitor/*', '', d)}"
+FILES:sensor-monitor += " ${bindir}/sensor-monitor"
+
+require ${BPN}.inc
+
+ALLOW_EMPTY:${PN} = "1"
+
+PKG_DEFAULT_MACHINE ??= "${MACHINE}"
+
+# Package configuration
+FAN_PACKAGES = " \
+        ${PN}-presence-tach \
+        ${PN}-control \
+        ${PN}-monitor \
+        ${PN}-sensor-monitor \
+"
+PACKAGE_BEFORE_PN += "${FAN_PACKAGES}"
+MULTI_USR_TGT = "multi-user.target"
+TMPL_TACH = "phosphor-fan-presence-tach@.service"
+INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
+POWERON_TGT = "obmc-chassis-poweron@{0}.target"
+FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.wants/${INSTFMT_TACH}"
+FMT_TACH_MUSR = "../${TMPL_TACH}:${MULTI_USR_TGT}.wants/${INSTFMT_TACH}"
+FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
+TMPL_CONTROL = "phosphor-fan-control@.service"
+INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
+FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
+FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}"
+FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.wants/${INSTFMT_CONTROL}"
+TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
+INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
+FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}"
+TMPL_MONITOR = "phosphor-fan-monitor@.service"
+INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
+FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
+FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.wants/${INSTFMT_MONITOR}"
+FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}"
+TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service"
+INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service"
+FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}"
+FAN_PACKAGES:append = "${@bb.utils.contains('PACKAGECONFIG', 'sensor-monitor', ' sensor-monitor', '', d)}"
diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control_git.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control_git.bb
index b521d32..10fb5d8 100644
--- a/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control_git.bb
+++ b/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control_git.bb
@@ -1,25 +1,12 @@
-SUMMARY = "Phosphor PID Fan Control"
-DESCRIPTION = "Fan Control"
-HOMEPAGE = "github.com/openbmc/phosphor-pid-control"
-PR = "r1"
-PV = "0.1+git${SRCPV}"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
-
-inherit autotools pkgconfig
-
-inherit obmc-phosphor-ipmiprovider-symlink
-inherit systemd
-
-S = "${WORKDIR}/git"
-SRC_URI = "git://github.com/openbmc/phosphor-pid-control;branch=master;protocol=https"
-SRCREV = "bcdeb83ca05ed0fa352290ec8f78bb28a2d1d2fb"
-
 # Each platform will need a service file that starts
 # at an appropriate time per system.  For instance, if
 # your system relies on passive dbus for fans or other
 # sensors then it may be prudent to wait for all of them.
-
+SUMMARY = "Phosphor PID Fan Control"
+DESCRIPTION = "Fan Control"
+HOMEPAGE = "github.com/openbmc/phosphor-pid-control"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 DEPENDS += "autoconf-archive-native"
 DEPENDS += "sdbusplus"
 DEPENDS += "phosphor-dbus-interfaces"
@@ -28,21 +15,29 @@
 DEPENDS += "nlohmann-json"
 DEPENDS += "cli11"
 DEPENDS += "boost"
-
 # We depend on this to be built first so we can build our providers.
 DEPENDS += "phosphor-ipmi-host"
+SRCREV = "bcdeb83ca05ed0fa352290ec8f78bb28a2d1d2fb"
+PV = "0.1+git${SRCPV}"
+PR = "r1"
 
+SRC_URI = "git://github.com/openbmc/phosphor-pid-control;branch=master;protocol=https"
+
+S = "${WORKDIR}/git"
 SERVICE_FILE = "phosphor-pid-control.service"
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE:${PN} = "${SERVICE_FILE}"
 
+inherit autotools pkgconfig
+inherit obmc-phosphor-ipmiprovider-symlink
+inherit systemd
+
 EXTRA_OECONF = " \
   SYSTEMD_TARGET="multi-user.target" \
   --disable-tests \
        "
 
 FILES:${PN} = "${bindir}/swampd ${bindir}/setsensor"
-
 # The following installs the OEM IPMI handler for the fan controls.
 FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
 FILES:${PN}:append = " ${libdir}/host-ipmid/lib*${SOLIBS}"
@@ -50,8 +45,7 @@
 FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"
 
 HOSTIPMI_PROVIDER_LIBRARY += "libmanualcmds.so"
-
-config_datadir="${datadir}/swampd/"
+config_datadir = "${datadir}/swampd/"
 # config_path is the location swampd expects to find a json configuration.
 # the file is expected to be named config.json
-config_path="${config_datadir}config.json"
+config_path = "${config_datadir}config.json"