diff options
| author | Willy Tu <wltu@google.com> | 2023-07-22 13:22:59 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-07-27 08:54:40 -0700 |
| commit | 4c201ede939610946847ccd4221320ed776224aa (patch) | |
| tree | 61b0b87e2d09f572771ed68b449901ef60616509 | |
| parent | 05cd18493a7f65ed542cf2a2eb5221ffd55de9b9 (diff) | |
| download | meta-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-stp | 18 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/networking/mstpd/mstpd.service | 10 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/networking/mstpd_git.bb | 32 |
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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | if [ "$#" -lt 2 ]; then | ||
| 3 | echo "Missing args: bridge-stp <bridge> <start|stop>" >&2 | ||
| 4 | exit 1 | ||
| 5 | fi | ||
| 6 | case "$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 | ||
| 18 | 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 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Multiple Spanning Tree Protocol Daemon | ||
| 3 | Before=network-pre.target | ||
| 4 | Wants=network-pre.target | ||
| 5 | [Service] | ||
| 6 | Restart=always | ||
| 7 | Type=simple | ||
| 8 | ExecStart=/usr/sbin/mstpd -d -v 2 | ||
| 9 | [Install] | ||
| 10 | 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 @@ | |||
| 1 | PR = "r1" | ||
| 2 | PV = "0.1+git${SRCPV}" | ||
| 3 | LICENSE = "GPL-2.0-or-later" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4325afd396febcb659c36b49533135d4" | ||
| 5 | |||
| 6 | SRC_URI = "git://github.com/mstpd/mstpd;branch=master;protocol=https" | ||
| 7 | SRCREV = "181c453fc1a00573e19f14960dcc54ad84beea7c" | ||
| 8 | S = "${WORKDIR}/git" | ||
| 9 | |||
| 10 | SRC_URI:append = " \ | ||
| 11 | file://bridge-stp \ | ||
| 12 | file://mstpd.service \ | ||
| 13 | " | ||
| 14 | |||
| 15 | inherit autotools pkgconfig systemd | ||
| 16 | |||
| 17 | PACKAGES =+ "${PN}-mstpd" | ||
| 18 | FILES:${PN}-mstpd = "${sbindir}/mstpd ${sbindir}/mstpctl ${sbindir}/bridge-stp" | ||
| 19 | |||
| 20 | SYSTEMD_PACKAGES = "${PN}-mstpd" | ||
| 21 | SYSTEMD_SERVICE:${PN}-mstpd = "mstpd.service" | ||
| 22 | |||
| 23 | do_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 | } | ||
