Inventory: Make changes for sync inventory for witherspoon

Add the environment file for witherspoon

Resolves openbmc/openbmc#2361

Change-Id: Id2aabb9e4c484e081f38f1afb33157e64a8453dd
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%.bbappend b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%.bbappend
new file mode 100644
index 0000000..c1d50e6
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%.bbappend
@@ -0,0 +1,24 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+INSTANCES = "motherboard/uuid motherboard/bmc/ethernet"
+ITEMS_FMT = "system/chassis/{0}"
+
+ITEMS = "${@compose_list(d, 'ITEMS_FMT', 'INSTANCES')}"
+
+ENV_FILES = "obmc/sync_inventory_item/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'ENV_FILES', 'ITEMS')}"
+
+TMPL = "obmc-sync-inventory-item@.service"
+TGT = "${SYSTEMD_DEFAULT_TARGET}"
+
+ETH_SVC = "system-chassis-motherboard-bmc-ethernet.service"
+UUID_SVC = "system-chassis-motherboard-uuid.service"
+
+ETH_DROPIN_DIR = "obmc-sync-inventory-item@${ETH_SVC}.d"
+UUID_DROPIN_DIR = "obmc-sync-inventory-item@${UUID_SVC}.d"
+
+SYSTEMD_OVERRIDE_${PN} += "mac_sync_inventory.conf:${ETH_DROPIN_DIR}/mac_sync_inventory.conf"
+SYSTEMD_OVERRIDE_${PN} += "uuid_sync_inventory.conf:${UUID_DROPIN_DIR}/uuid_sync_inventory.conf"
+
+SYSTEMD_LINK_${PN} += "../${TMPL}:${TGT}.wants/obmc-sync-inventory-item@${ETH_SVC}"
+SYSTEMD_LINK_${PN} += "../${TMPL}:${TGT}.wants/obmc-sync-inventory-item@${UUID_SVC}"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/mac_sync_inventory.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/mac_sync_inventory.conf
new file mode 100644
index 0000000..f04b6dd
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/mac_sync_inventory.conf
@@ -0,0 +1,6 @@
+[Unit]
+Wants=mapper-wait@-xyz-openbmc_project-network-config.service
+After=mapper-wait@-xyz-openbmc_project-network-config.service
+
+Wants=op-vpd-parser.service
+After=op-vpd-parser.service
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard/bmc/ethernet b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard/bmc/ethernet
new file mode 100644
index 0000000..722e0e6
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard/bmc/ethernet
@@ -0,0 +1,2 @@
+PROPERTY="MACAddress"
+SYNC_TYPE=mac
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard/uuid b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard/uuid
new file mode 100644
index 0000000..95abbc8
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/obmc/sync_inventory_item/system/chassis/motherboard/uuid
@@ -0,0 +1,2 @@
+PROPERTY="UUID"
+SYNC_TYPE=uuid
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/uuid_sync_inventory.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/uuid_sync_inventory.conf
new file mode 100644
index 0000000..5874762
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/obmc-mgr-inventory%/uuid_sync_inventory.conf
@@ -0,0 +1,3 @@
+[Unit]
+Wants=op-vpd-parser.service
+After=op-vpd-parser.service
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service
index f9654fe..0e294a1 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service
@@ -1,7 +1,5 @@
 [Unit]
 Description=Sync %I
-Wants=obmc-read-eeprom@%i.service
-After=obmc-read-eeprom@%i.service
 
 [Service]
 Restart=no