summaryrefslogtreecommitdiffstats
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
parent05cd18493a7f65ed542cf2a2eb5221ffd55de9b9 (diff)
downloadmeta-openembedded-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>
-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 000000000..59c5786b7
--- /dev/null
+++ b/meta-oe/recipes-extended/networking/mstpd/bridge-stp
@@ -0,0 +1,18 @@
1#!/bin/sh
2if [ "$#" -lt 2 ]; then
3 echo "Missing args: bridge-stp <bridge> <start|stop>" >&2
4 exit 1
5fi
6case "$2" in
7 start)
8 /usr/sbin/mstpctl addbridge "$1"
9 exit
10 ;;
11 stop)
12 /usr/sbin/mstpctl delbridge "$1"
13 exit
14 ;;
15 *)
16 echo "Invalid operation: $2" >&2
17 exit 1
18esac
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 000000000..645db893c
--- /dev/null
+++ b/meta-oe/recipes-extended/networking/mstpd/mstpd.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=Multiple Spanning Tree Protocol Daemon
3Before=network-pre.target
4Wants=network-pre.target
5[Service]
6Restart=always
7Type=simple
8ExecStart=/usr/sbin/mstpd -d -v 2
9[Install]
10WantedBy=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 000000000..e2565d620
--- /dev/null
+++ b/meta-oe/recipes-extended/networking/mstpd_git.bb
@@ -0,0 +1,32 @@
1PR = "r1"
2PV = "0.1+git${SRCPV}"
3LICENSE = "GPL-2.0-or-later"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=4325afd396febcb659c36b49533135d4"
5
6SRC_URI = "git://github.com/mstpd/mstpd;branch=master;protocol=https"
7SRCREV = "181c453fc1a00573e19f14960dcc54ad84beea7c"
8S = "${WORKDIR}/git"
9
10SRC_URI:append = " \
11 file://bridge-stp \
12 file://mstpd.service \
13"
14
15inherit autotools pkgconfig systemd
16
17PACKAGES =+ "${PN}-mstpd"
18FILES:${PN}-mstpd = "${sbindir}/mstpd ${sbindir}/mstpctl ${sbindir}/bridge-stp"
19
20SYSTEMD_PACKAGES = "${PN}-mstpd"
21SYSTEMD_SERVICE:${PN}-mstpd = "mstpd.service"
22
23do_install:append() {
24 rm -rf ${D}${libexecdir} ${D}${libdir}/NetworkManager
25 rmdir ${D}${libdir} || true
26
27 install -d -m 0755 ${D}/${sbindir}
28 install -m 0755 ${WORKDIR}/bridge-stp ${D}/${sbindir}
29
30 install -d -m 0755 ${D}${systemd_system_unitdir}
31 install -m 0644 ${WORKDIR}/mstpd.service ${D}${systemd_system_unitdir}/
32}