Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions meta-oe/recipes-extended/networking/mstpd/bridge-stp
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions meta-oe/recipes-extended/networking/mstpd/mstpd.service
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions meta-oe/recipes-extended/networking/mstpd_git.bb
Original file line number Diff line number Diff line change
@@ -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}/
}