Barreleye: Prepare for systemd

Barreleye specific overrides in preparation for the move to
systemd state management.

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com
Change-Id: Ifaca2e849625530ac97accdf0542d14f9708ee0f
diff --git a/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf b/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf
index 3254023..890d919 100644
--- a/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf
+++ b/meta-rackspace/meta-barreleye/conf/machine/barreleye.conf
@@ -10,3 +10,5 @@
 UBOOT_LOADADDRESS = "0x40008000"
 
 FLASH_SIZE = "32768"
+
+OBMC_FAN_INSTANCES = "0 1 2 3 4 5"
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%.bbappend b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%.bbappend
new file mode 100644
index 0000000..05e1c09
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%.bbappend
@@ -0,0 +1,18 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+EEPROM_NAMES = "io_board motherboard sas_expander hdd_backplane"
+
+EEPROMFMT = "system/chassis/{0}"
+EEPROM_ESCAPEDFMT = "system-chassis-{0}"
+EEPROMS = "${@compose_list(d, 'EEPROMFMT', 'EEPROM_NAMES')}"
+EEPROMS_ESCAPED = "${@compose_list(d, 'EEPROM_ESCAPEDFMT', 'EEPROM_NAMES')}"
+
+ENVFMT = "obmc/eeproms/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'ENVFMT', 'EEPROMS')}"
+
+TMPL = "obmc-read-eeprom@.service"
+TGT = "${SYSTEMD_DEFAULT_TARGET}"
+INSTFMT = "obmc-read-eeprom@{0}.service"
+FMT = "../${TMPL}:${TGT}.wants/${INSTFMT}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/hdd_backplane b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/hdd_backplane
new file mode 100644
index 0000000..b1ed875
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/hdd_backplane
@@ -0,0 +1,2 @@
+SYSFS_PATH=/sys/bus/i2c/devices/6-0055/eeprom
+FRUID=66
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/io_board b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/io_board
new file mode 100644
index 0000000..6a11a3d
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/io_board
@@ -0,0 +1,2 @@
+SYSFS_PATH=/sys/bus/i2c/devices/0-0050/eeprom
+FRUID=64
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/motherboard b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/motherboard
new file mode 100644
index 0000000..ff73090
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/motherboard
@@ -0,0 +1,2 @@
+SYSFS_PATH=/sys/bus/i2c/devices/4-0054/eeprom
+FRUID=3
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/sas_expander b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/sas_expander
new file mode 100644
index 0000000..5bc455d
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/host-ipmid/host-ipmid-fru%/obmc/eeproms/system/chassis/sas_expander
@@ -0,0 +1,2 @@
+SYSFS_PATH=/sys/bus/i2c/devices/6-0051/eeprom
+FRUID=65
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%.bbappend b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%.bbappend
new file mode 100644
index 0000000..aeb3dd3
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%.bbappend
@@ -0,0 +1,18 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+NAMES = "io_board motherboard"
+ITEMSFMT = "system/chassis/{0}"
+ITEMS_ESCAPEDFMT = "system-chassis-{0}"
+
+ITEMS = "${@compose_list(d, 'ITEMSFMT', 'NAMES')}"
+ITEMS_ESCAPED = "${@compose_list(d, 'ITEMS_ESCAPEDFMT', 'NAMES')}"
+
+ENVS = "obmc/sync_inventory_item/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'ENVS', 'ITEMS')}"
+
+TMPL = "obmc-sync-inventory-item@.service"
+TGT = "${SYSTEMD_DEFAULT_TARGET}"
+INSTFMT = "obmc-sync-inventory-item@{0}.service"
+FMT = "../${TMPL}:${TGT}.wants/${INSTFMT}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'ITEMS_ESCAPED')}"
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/io_board b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/io_board
new file mode 100644
index 0000000..5a1d94a
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/io_board
@@ -0,0 +1,4 @@
+FRU_TYPE=DAUGHTER_CARD
+FRU_NAME=io_board
+PROPERTY="Custom Field 2"
+SYNC_TYPE=mac
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard
new file mode 100644
index 0000000..bc632f4
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard
@@ -0,0 +1,4 @@
+FRU_TYPE=MAIN_PLANAR
+FRU_NAME=motherboard
+PROPERTY="Custom Field 1"
+SYNC_TYPE=uuid
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan%.bbappend b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan%.bbappend
new file mode 100644
index 0000000..c4abaf6
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-fan/obmc-control-fan%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SVC = "obmc-max-fans.service"
+TGTFMT = "obmc-power-start@{0}.target"
+FMT = "../${SVC}:${TGTFMT}.wants/${SVC}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_POWER_INSTANCES')}"
diff --git a/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-led/obmc-control-led%.bbappend b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-led/obmc-control-led%.bbappend
new file mode 100644
index 0000000..a69ae23
--- /dev/null
+++ b/meta-rackspace/meta-barreleye/recipes-phosphor/obmc-phosphor-led/obmc-control-led%.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SYSTEMD_LINK_${PN} += "../obmc-led-start@.service:${SYSTEMD_DEFAULT_TARGET}.wants/obmc-led-start@beep.service"
+
+STATES = "start stop"
+TMPLFMT = "obmc-led-{0}@.service"
+TGTFMT = "obmc-power-{0}@0.target"
+INSTFMT = "obmc-led-{0}@identify.service"
+FMT = "../${TMPLFMT}:${TGTFMT}.wants/${INSTFMT}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'STATES')}"