diff options
author | Vernon Mauery <vernon.mauery@linux.intel.com> | 2019-03-22 22:25:14 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-04-29 23:02:39 +0300 |
commit | 3313659bf25c9ad4d608282d088a1717977983e9 (patch) | |
tree | a0ce9b2dac008bcf4ce1e467d223147d53916cbf /meta-phosphor | |
parent | d378c5e096c2e6e54d06bed5b5c273c218129256 (diff) | |
download | openbmc-3313659bf25c9ad4d608282d088a1717977983e9.tar.xz |
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 \
"
(From meta-phosphor rev: e46895beb45726a2154e66f30d5f41167014d127)
Change-Id: If856e938f5be95ca450bb4403d1c20ebcf11a7c6
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor')
4 files changed, 27 insertions, 43 deletions
diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/ipmi-net-firewall.sh b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/ipmi-net-firewall.sh deleted file mode 100644 index ca32f985a..000000000 --- a/meta-phosphor/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/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service deleted file mode 100644 index 6b836b604..000000000 --- a/meta-phosphor/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/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket deleted file mode 100644 index 077b7804c..000000000 --- a/meta-phosphor/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/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb index f54eb28c4..77df8442a 100644 --- a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net_git.bb @@ -7,28 +7,44 @@ LICENSE = "Apache-2.0" 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 -} +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}.service \ - ${PN}.socket \ + ${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 + |