Make phosphor-ipmi-net parameterized per iface

The end goal is to run one netipmid bridge per interface, so that
stopping that bridge will effectively shut down RMCP+ to that interface.

Including this package (phosphor-ipmi-net) in a yocto build will
automatically enable RMCP+ on the default interface (eth0). To change
the default interface enabled, set the value in a bbappend:

RMCPP_IFACE = "eth2"

If more than one network device for RMCP+ is needed, then a bbappend
should be added to enable netipmid on that device using syntax like
as follows:

phosphor-ipmi-net_%.bbappend:

ALT_RMCPP_IFACE = "eth1"
SYSTEMD_SERVICE_${PN} += " \
    ${PN}@${ALT_RMCPP_IFACE}.service \
    ${PN}@${ALT_RMCPP_IFACE}.socket \
    "

Change-Id: I00e560b7d9e8da1d5125d74958696972d6f69d8a
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb b/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb
index f54eb28..77df844 100644
--- a/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb
+++ b/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb
@@ -7,28 +7,44 @@
 LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
 
 inherit autotools pkgconfig
-inherit obmc-phosphor-systemd
+inherit systemd
 
 DEPENDS += "autoconf-archive-native"
 DEPENDS += "cli11"
 DEPENDS += "phosphor-mapper"
 DEPENDS += "systemd"
 DEPENDS += "phosphor-ipmi-host"
-RDEPENDS_${PN} += "iptables"
 
 SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid"
-SRC_URI += "file://ipmi-net-firewall.sh"
-SRCREV = "8af90ebcc552e243ae85aa9e9da1a00fbecab56c"
+SRCREV = "d92bc324ffa70d7f12f96e44ca6031e3e16224bd"
 
 S = "${WORKDIR}/git"
 
-do_install_append() {
-        install -d ${D}${bindir}
-        install -m 0755 ${WORKDIR}/ipmi-net-firewall.sh \
-        ${D}${bindir}/ipmi-net-firewall.sh
-}
-
-SYSTEMD_SERVICE_${PN} = " \
-        ${PN}.service \
-        ${PN}.socket \
+FILES_${PN} += " \
+        ${systemd_system_unitdir}/${PN}@.service \
+        ${systemd_system_unitdir}/${PN}@.socket \
         "
+
+# If RMCPP_IFACE is not set by bbappend, set it to default
+DEFAULT_RMCPP_IFACE = "eth0"
+RMCPP_IFACE ?= "${DEFAULT_RMCPP_IFACE}"
+
+# install parameterized service and socket files
+SYSTEMD_SERVICE_${PN} = " \
+        ${PN}@${RMCPP_IFACE}.service \
+        ${PN}@${RMCPP_IFACE}.socket \
+        "
+
+# To add another RMCPP interface, add similar lines to the
+# following lines in a bbappend:
+#
+# ALT_RMCPP_IFACE = "eth1"
+# SYSTEMD_SERVICE_${PN} += " \
+#     ${PN}@${ALT_RMCPP_IFACE}.service \
+#     ${PN}@${ALT_RMCPP_IFACE}.socket \
+#     "
+
+# Also, be sure to enable a corresponding entry in the channel
+# config file with the same 'name' as the interfaces above
+# Override the default phosphor-ipmi-config.bb with a bbappend
+