aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended
diff options
context:
space:
mode:
authorWilly Tu <wltu@google.com>2023-07-22 13:22:59 -0700
committerKhem Raj <raj.khem@gmail.com>2023-07-27 08:54:40 -0700
commit4c201ede939610946847ccd4221320ed776224aa (patch)
tree61b0b87e2d09f572771ed68b449901ef60616509 /meta-oe/recipes-extended
parent05cd18493a7f65ed542cf2a2eb5221ffd55de9b9 (diff)
downloadmeta-openembedded-contrib-4c201ede939610946847ccd4221320ed776224aa.tar.gz
mstpd: Add initial recipe for mstpd
This adds the mstpd package, a daemon implementing RSTP and MSTP protocols in place of the kernel STP implementation. Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rw-r--r--meta-oe/recipes-extended/networking/mstpd/bridge-stp18
-rw-r--r--meta-oe/recipes-extended/networking/mstpd/mstpd.service10
-rw-r--r--meta-oe/recipes-extended/networking/mstpd_git.bb32
3 files changed, 60 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/networking/mstpd/bridge-stp b/meta-oe/recipes-extended/networking/mstpd/bridge-stp
new file mode 100644
index 0000000000..59c5786b74
--- /dev/null
+++ b/meta-oe/recipes-extended/networking/mstpd/bridge-stp
@@ -0,0 +1,18 @@
+#!/bin/sh
+if [ "$#" -lt 2 ]; then
+ echo "Missing args: bridge-stp <bridge> <start|stop>" >&2
+ exit 1
+fi
+case "$2" in
+ start)
+ /usr/sbin/mstpctl addbridge "$1"
+ exit
+ ;;
+ stop)
+ /usr/sbin/mstpctl delbridge "$1"
+ exit
+ ;;
+ *)
+ echo "Invalid operation: $2" >&2
+ exit 1
+esac
diff --git a/meta-oe/recipes-extended/networking/mstpd/mstpd.service b/meta-oe/recipes-extended/networking/mstpd/mstpd.service
new file mode 100644
index 0000000000..645db893cc
--- /dev/null
+++ b/meta-oe/recipes-extended/networking/mstpd/mstpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Multiple Spanning Tree Protocol Daemon
+Before=network-pre.target
+Wants=network-pre.target
+[Service]
+Restart=always
+Type=simple
+ExecStart=/usr/sbin/mstpd -d -v 2
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-oe/recipes-extended/networking/mstpd_git.bb b/meta-oe/recipes-extended/networking/mstpd_git.bb
new file mode 100644
index 0000000000..e2565d6201
--- /dev/null
+++ b/meta-oe/recipes-extended/networking/mstpd_git.bb
@@ -0,0 +1,32 @@
+PR = "r1"
+PV = "0.1+git${SRCPV}"
+LICENSE = "GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4325afd396febcb659c36b49533135d4"
+
+SRC_URI = "git://github.com/mstpd/mstpd;branch=master;protocol=https"
+SRCREV = "181c453fc1a00573e19f14960dcc54ad84beea7c"
+S = "${WORKDIR}/git"
+
+SRC_URI:append = " \
+ file://bridge-stp \
+ file://mstpd.service \
+"
+
+inherit autotools pkgconfig systemd
+
+PACKAGES =+ "${PN}-mstpd"
+FILES:${PN}-mstpd = "${sbindir}/mstpd ${sbindir}/mstpctl ${sbindir}/bridge-stp"
+
+SYSTEMD_PACKAGES = "${PN}-mstpd"
+SYSTEMD_SERVICE:${PN}-mstpd = "mstpd.service"
+
+do_install:append() {
+ rm -rf ${D}${libexecdir} ${D}${libdir}/NetworkManager
+ rmdir ${D}${libdir} || true
+
+ install -d -m 0755 ${D}/${sbindir}
+ install -m 0755 ${WORKDIR}/bridge-stp ${D}/${sbindir}
+
+ install -d -m 0755 ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/mstpd.service ${D}${systemd_system_unitdir}/
+}