Enable JSON to Map Inventory Object with Network Interface

- This commit would enable a configuration JSON file, through which
  one can map the inventory object paths to the actual ethernet
  interfaces which are managed Network Service.

For Example:

- Lets say the Inventory path for a single ethernet Interface machine
  would look something like below:

  `/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/ethernet`

  Then the corresponding configuration JSON would looks something like below:
  {
            "eth0":"ethernet"
  }

  Note that the key (eth0) in the JSON is the actual ethernet Interface
  managed by the Network Service, and the value (ethernet) is the search
  pattern to be found in the Inventory Path String.

- The above JSON would help the phosphor-network service to look for a
  match on the Interface Added signal under Inventory Path with an object
  path that contains the pattern String ("ethernet"), and there it gets the
  MAC address populated under the respective inventory path and set it as
  the MAC address of the eth0 Interface.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Ic2ca6a18262128172a738f6ddee91e6811994ee7
diff --git a/recipes-phosphor/network/phosphor-network_%.bbappend b/recipes-phosphor/network/phosphor-network_%.bbappend
index bcb2d01..178a921 100644
--- a/recipes-phosphor/network/phosphor-network_%.bbappend
+++ b/recipes-phosphor/network/phosphor-network_%.bbappend
@@ -1,15 +1,32 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/network:"
-SRC_URI_append_ibm-ac-server = " file://ncsi-netlink.service"
-SRC_URI_append_mihawk = " file://ncsi-netlink.service"
 
-SYSTEMD_SERVICE_${PN}_append_ibm-ac-server = " ncsi-netlink.service"
-SYSTEMD_SERVICE_${PN}_append_mihawk = " ncsi-netlink.service"
+SRC_URI += " file://ncsi-netlink.service"
+SYSTEMD_SERVICE_${PN} += " ncsi-netlink.service"
+FILES_${PN} += "${datadir}/network/*.json"
 
-do_install_append_ibm-ac-server() {
+install_network_configuration(){
     install -d ${D}${systemd_system_unitdir}
     install -m 0644 ${WORKDIR}/ncsi-netlink.service ${D}${systemd_system_unitdir}
+    install -d ${D}${datadir}/network/
+    install -m 0644 ${WORKDIR}/inventory-object-map.json ${D}${datadir}/network/config.json
 }
+
+SRC_URI_append_rainier = " file://inventory-object-map.json"
+do_install_append_rainier(){
+    install_network_configuration
+}
+
+SRC_URI_append_ibm-ac-server = " file://inventory-object-map.json"
+do_install_append_ibm-ac-server() {
+    install_network_configuration
+}
+
+SRC_URI_append_mihawk = " file://inventory-object-map.json"
 do_install_append_mihawk() {
-    install -d ${D}${systemd_system_unitdir}
-    install -m 0644 ${WORKDIR}/ncsi-netlink.service ${D}${systemd_system_unitdir}
+    install_network_configuration
+}
+
+SRC_URI_append_witherspoon-tacoma = " file://inventory-object-map.json"
+do_install_append_witherspoon-tacoma(){
+    install_network_configuration
 }