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/ipmi-net-firewall.sh b/recipes-phosphor/ipmi/phosphor-ipmi-net/ipmi-net-firewall.sh
deleted file mode 100644
index ca32f98..0000000
--- a/recipes-phosphor/ipmi/phosphor-ipmi-net/ipmi-net-firewall.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-if [ -f $IPTABLESRULE ]; then
- iptables-restore < $IPTABLESRULE
-fi
diff --git a/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service b/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service
deleted file mode 100644
index 6b836b6..0000000
--- a/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service
+++ /dev/null
@@ -1,21 +0,0 @@
-[Unit]
-Description=Network IPMI daemon
-# TODO openbmc/openbmc#2059 - The wants/after below should be based on providers
-Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot.service
-After=mapper-wait@-xyz-openbmc_project-control-host0-boot.service
-Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service
-After=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service
-Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service
-After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service
-Wants=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service
-After=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service
-
-[Service]
-Environment=IPTABLESRULE=/var/lib/iptables_rules
-ExecStartPre=/usr/bin/env ipmi-net-firewall.sh
-ExecStart=/usr/bin/env netipmid
-SyslogIdentifier=netipmid
-Restart=always
-RuntimeDirectory = ipmi
-RuntimeDirectoryPreserve = yes
-StateDirectory = ipmi
diff --git a/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket b/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket
deleted file mode 100644
index 077b780..0000000
--- a/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket
+++ /dev/null
@@ -1,6 +0,0 @@
-[Socket]
-ListenDatagram=623
-
-[Install]
-WantedBy=sockets.target
-
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
+