meta-ibm: fans: Create machine-specific structure

Yocto automatically adds files/<MACHINE>/ to the file path, take
advantage of this feature to simplify the recipe and directory
structure.

Tested: Built witherspoon, witherspoon-128, and swift, and verified
        they all had the correct fans files in their image.

Change-Id: I22850da7ebbf0c64faa790aaf9a4240d710580ca
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bbappend
index fae8d4c..72d991c 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-events-config-native/events.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-events-config-native/witherspoon/events.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-events-config-native/events.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-events-config-native/witherspoon/events.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bbappend
index fae8d4c..72d991c 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-fan-config-native/fans.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native/swift/fans.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-fan-config-native/fans.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native/swift/fans.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-fan-config-native/fans.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native/witherspoon/fans.yaml
old mode 100644
new mode 100755
similarity index 100%
copy from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-fan-config-native/fans.yaml
copy to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-fan-config-native/witherspoon/fans.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bbappend
index fae8d4c..72d991c 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native/swift/zone_conditions.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native/swift/zone_conditions.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native/witherspoon/zone_conditions.yaml
similarity index 100%
copy from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml
copy to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native/witherspoon/zone_conditions.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bbappend
index fae8d4c..72d991c 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-zone-config-native/zones.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native/swift/zones.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan-control-zone-config-native/zones.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native/swift/zones.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-zone-config-native/zones.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native/witherspoon/zones.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-zone-config-native/zones.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-control-zone-config-native/witherspoon/zones.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bbappend
index fae8d4c..72d991c 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-monitor-config-native/monitor.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native/witherspoon/monitor.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-monitor-config-native/monitor.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-monitor-config-native/witherspoon/monitor.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-presence-config-native.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-presence-config-native.bbappend
index fae8d4c..72d991c 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-presence-config-native.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-presence-config-native.bbappend
@@ -1 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-presence-config-native/config.yaml b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan-presence-config-native/witherspoon/config.yaml
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-presence-config-native/config.yaml
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan-presence-config-native/witherspoon/config.yaml
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan/swift/obmc/phosphor-fan/phosphor-cooling-type-0.conf
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan/swift/obmc/phosphor-fan/phosphor-cooling-type-0.conf
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/phosphor-cooling-type@.service b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan/swift/phosphor-cooling-type@.service
similarity index 100%
rename from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/phosphor-cooling-type@.service
rename to meta-witherspoon/recipes-phosphor/fans/phosphor-fan/swift/phosphor-cooling-type@.service
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan/witherspoon/obmc/phosphor-fan/phosphor-cooling-type-0.conf
similarity index 100%
copy from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf
copy to meta-witherspoon/recipes-phosphor/fans/phosphor-fan/witherspoon/obmc/phosphor-fan/phosphor-cooling-type-0.conf
diff --git a/meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/phosphor-cooling-type@.service b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan/witherspoon/phosphor-cooling-type@.service
similarity index 100%
copy from meta-witherspoon/recipes-phosphor/fans/swift-phosphor-fan/phosphor-cooling-type@.service
copy to meta-witherspoon/recipes-phosphor/fans/phosphor-fan/witherspoon/phosphor-cooling-type@.service
diff --git a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend
index 9942eca..bc6ea80 100644
--- a/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend
+++ b/meta-witherspoon/recipes-phosphor/fans/phosphor-fan_%.bbappend
@@ -1,6 +1,4 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-# Machine specific files override shared files with the same name
-FILESEXTRAPATHS_prepend := "${THISDIR}/${MACHINE}-${PN}:"
+FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
 
 # Package configuration
 FAN_PACKAGES += " \
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-fan-config-native/fans.yaml b/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-fan-config-native/fans.yaml
deleted file mode 100755
index a70ac85..0000000
--- a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-fan-config-native/fans.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-fans:
-  - inventory: /system/chassis/motherboard/fan2
-    cooling_zone: 0
-    cooling_profile: all
-    sensors:
-      - fan2_0
-  - inventory: /system/chassis/motherboard/fan0
-    cooling_zone: 0
-    cooling_profile: all
-    sensors:
-      - fan0_0
-  - inventory: /system/chassis/motherboard/fan1
-    cooling_zone: 0
-    cooling_profile: air
-    sensors:
-      - fan1_0
-  - inventory: /system/chassis/motherboard/fan3
-    cooling_zone: 0
-    cooling_profile: all
-    sensors:
-      - fan3_0
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml b/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml
deleted file mode 100644
index 0c8b3c5..0000000
--- a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan-control-zone-conditions-config-native/zone_conditions.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-conditions:
-  - name: air_cooled_chassis
-    type: getProperty
-    properties:
-      - property: WaterCooled
-        interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
-        path: /xyz/openbmc_project/inventory/system/chassis
-        type: bool
-        value: false
-
-  - name: water_and_air_cooled_chassis
-    type: getProperty
-    properties:
-      - property: WaterCooled
-        interface: xyz.openbmc_project.Inventory.Decorator.CoolingType
-        path: /xyz/openbmc_project/inventory/system/chassis
-        type: bool
-        value: true
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf b/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf
deleted file mode 100644
index e5e8f43..0000000
--- a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan/obmc/phosphor-fan/phosphor-cooling-type-0.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-OBJPATH="--path=/system/chassis"
-AIR="--air"
-WATER=""
-DEVICE="--dev=/dev/input/by-path/platform-gpio-keys-event"
-CODE="--event=13"
-
diff --git a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan/phosphor-cooling-type@.service b/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan/phosphor-cooling-type@.service
deleted file mode 100644
index c1f5ae2..0000000
--- a/meta-witherspoon/recipes-phosphor/fans/witherspoon-phosphor-fan/phosphor-cooling-type@.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=Phosphor Cooling Type
-Wants=mapper-wait@-xyz-openbmc_project-inventory.service
-After=mapper-wait@-xyz-openbmc_project-inventory.service
-ConditionPathExists={envfiledir}/obmc/phosphor-fan/phosphor-cooling-type-%i.conf
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-EnvironmentFile={envfiledir}/obmc/phosphor-fan/phosphor-cooling-type-%i.conf
-ExecStart=/usr/bin/env phosphor-cooling-type ${{OBJPATH}} ${{AIR}} ${{WATER}} ${{DEVICE}} ${{CODE}}
-SyslogIdentifier=phosphor-cooling-type
-
-[Install]
-RequiredBy=multi-user.target