diff options
author | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2021-03-21 11:28:02 +0200 |
---|---|---|
committer | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2021-03-21 11:28:02 +0200 |
commit | a83294b680f9f3d55d6056c5b23addd88a4555d3 (patch) | |
tree | 5b64b931dcebc857186dd4ddfa4c73af5079d8a8 | |
parent | 343eb7426cc5720f46cbff2ae2bf0c9b9a716d7e (diff) | |
parent | ebc0cc9906fd565c187fa0901002d30229e08de9 (diff) | |
download | meta-mlinux-a83294b680f9f3d55d6056c5b23addd88a4555d3.tar.gz meta-mlinux-a83294b680f9f3d55d6056c5b23addd88a4555d3.tar.bz2 meta-mlinux-a83294b680f9f3d55d6056c5b23addd88a4555d3.zip |
Merge remote-tracking branch 'origin/dunfell' into mtre-dunfell
11 files changed, 284 insertions, 8 deletions
diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.conf b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.conf index 6b861d6..6b861d6 100644 --- a/recipes-connectivity/mosquitto/mosquitto/mosquitto.conf +++ b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.conf diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.default b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.default index be7dcd5..be7dcd5 100644 --- a/recipes-connectivity/mosquitto/mosquitto/mosquitto.default +++ b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.default diff --git a/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.init b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.init new file mode 100755 index 0000000..21bffe6 --- /dev/null +++ b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.init @@ -0,0 +1,96 @@ +#! /bin/sh + +# Based on the Debian initscript for mosquitto + +### BEGIN INIT INFO +# Provides: mosquitto +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: mosquitto MQTT message broker +# Description: +# This is a message broker that supports version 3.1/3.1.1 of the MQ Telemetry +# Transport (MQTT) protocol. +# +# MQTT provides a method of carrying out messaging using a publish/subscribe +# model. It is lightweight, both in terms of bandwidth usage and ease of +# implementation. This makes it particularly useful at the edge of the network +# where a sensor or other simple device may be implemented using an arduino for +# example. +### END INIT INFO + +## mlinux +ENABLED="yes" + +[ -f /etc/default/mosquitto ] && . /etc/default/mosquitto +[ "$ENABLED" = "yes" ] || exit +## mlinux + +set -e + +PIDFILE=@LOCALSTATEDIR@/run/mosquitto.pid +DAEMON=@SBINDIR@/mosquitto + +# start and stop the mosquitto MQTT message broker + +test -x ${DAEMON} || exit 0 + +umask 022 + +. @SYSCONFDIR@/init.d/functions + +export PATH="${PATH:+$PATH:}@SBINDIR@:@BASE_SBINDIR@" + +case "$1" in + start) + echo "Starting Mosquitto message broker" "mosquitto" + if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then + exit 0 + else + exit 1 + fi + ;; + stop) + echo "Stopping Mosquitto message broker" "mosquitto" + if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}; then + rm -f ${PIDFILE} + exit 0 + else + exit 1 + fi + ;; + + + reload|force-reload) + if [ -f ${PIDFILE} ] ; then + echo "Reloading configuration for mosquitto" + pid=`cat ${PIDFILE}` + kill -HUP $pid + else + echo "mosquitto does not seem to be running" + fi + ;; + + restart) + echo "Restarting Mosquitto message broker" "mosquitto" + if start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${PIDFILE}; then + rm -f ${PIDFILE} + fi + if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then + exit 0 + else + exit 1 + fi + ;; + + status) + status ${DAEMON} && exit 0 || exit $? + ;; + + *) + echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" + exit 1 +esac + +exit 0 diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.logrotate.conf b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.logrotate.conf index 5f4779b..5f4779b 100644 --- a/recipes-connectivity/mosquitto/mosquitto/mosquitto.logrotate.conf +++ b/recipes-connectivity/mosquitto/mosquitto-mlinux/mosquitto.logrotate.conf diff --git a/recipes-connectivity/mosquitto/mosquitto/1571.patch b/recipes-connectivity/mosquitto/mosquitto/1571.patch new file mode 100644 index 0000000..93ff6bc --- /dev/null +++ b/recipes-connectivity/mosquitto/mosquitto/1571.patch @@ -0,0 +1,22 @@ +Upstream-Status: Submitted [https://github.com/eclipse/mosquitto/pull/1571] +From 3fe5468f1bdca1bff1d18cf43c9e338f41aa9e32 Mon Sep 17 00:00:00 2001 +From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> +Date: Wed, 22 Jan 2020 12:39:49 +0100 +Subject: [PATCH] Add dynamic symbols linking with cmake too + +Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> +--- + lib/CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -89,6 +89,8 @@ + OUTPUT_NAME mosquitto + VERSION ${VERSION} + SOVERSION 1 ++ LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/linker.version ++ LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/linker.version" + ) + + install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") diff --git a/recipes-connectivity/mosquitto/mosquitto/install-protocol.patch b/recipes-connectivity/mosquitto/mosquitto/install-protocol.patch new file mode 100644 index 0000000..1397fc6 --- /dev/null +++ b/recipes-connectivity/mosquitto/mosquitto/install-protocol.patch @@ -0,0 +1,14 @@ +Description: Also install mqtt_protocol.h, as is done in Makefile +Author: Gianfranco Costamagna <locutusofborg@debian.org> +Bug-Debian: https://bugs.debian.org/951116 +Forwarded: https://github.com/eclipse/mosquitto/pull/1599 +Last-Update: 2020-02-15 + +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -114,4 +114,4 @@ + install(TARGETS libmosquitto_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif (WITH_STATIC_LIBRARIES) + +-install(FILES mosquitto.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++install(FILES mqtt_protocol.h mosquitto.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/recipes-connectivity/mosquitto/mosquitto/mosquitto.init b/recipes-connectivity/mosquitto/mosquitto/mosquitto.init index 21bffe6..9d5963c 100755..100644 --- a/recipes-connectivity/mosquitto/mosquitto/mosquitto.init +++ b/recipes-connectivity/mosquitto/mosquitto/mosquitto.init @@ -20,13 +20,6 @@ # example. ### END INIT INFO -## mlinux -ENABLED="yes" - -[ -f /etc/default/mosquitto ] && . /etc/default/mosquitto -[ "$ENABLED" = "yes" ] || exit -## mlinux - set -e PIDFILE=@LOCALSTATEDIR@/run/mosquitto.pid diff --git a/recipes-connectivity/mosquitto/mosquitto_1.6.14.bb b/recipes-connectivity/mosquitto/mosquitto_1.6.14.bb new file mode 100644 index 0000000..fffe7de --- /dev/null +++ b/recipes-connectivity/mosquitto/mosquitto_1.6.14.bb @@ -0,0 +1,87 @@ +SUMMARY = "Open source MQTT implementation" +DESCRIPTION = "Mosquitto is an open source (Eclipse licensed) message broker \ +that implements the MQ Telemetry Transport protocol version 3.1, 3.1.1 and \ +5, providing both an MQTT broker and several command-line clients. MQTT \ +provides a lightweight method of carrying out messaging using a \ +publish/subscribe model. " +HOMEPAGE = "http://mosquitto.org/" +SECTION = "console/network" +LICENSE = "EPL-1.0 | EDL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20 \ + file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \ + file://epl-v10;md5=8d383c379e91d20ba18a52c3e7d3a979 \ + file://notice.html;md5=a00d6f9ab542be7babc2d8b80d5d2a4c \ +" +DEPENDS = "uthash" + +SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ + file://mosquitto.init \ + file://1571.patch \ + file://install-protocol.patch \ +" + +SRC_URI[md5sum] = "f1746b2a074f6a576e4bc302f3fffee0" +SRC_URI[sha256sum] = "5ea7e342bfbd212a0addb915036be168040dea945e5de5fe739c43c5ff3823e4" + +inherit systemd update-rc.d useradd cmake + +PACKAGECONFIG ??= "ssl dlt websockets \ + ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \ + " + +PACKAGECONFIG[dns-srv] = "-DWITH_SRV=ON,-DWITH_SRV=OFF,c-ares" +PACKAGECONFIG[ssl] = "-DWITH_TLS=ON -DWITH_TLS_PSK=ON -DWITH_EC=ON,-DWITH_TLS=OFF -DWITH_TLS_PSK=OFF -DWITH_EC_OFF,openssl" +PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF,systemd" +PACKAGECONFIG[websockets] = "-DWITH_WEBSOCKETS=ON,-DWITH_WEBSOCKETS=OFF,libwebsockets" +PACKAGECONFIG[dlt] = "-DWITH_DLT=ON,-DWITH_DLT=OFF,dlt-daemon" + +EXTRA_OECMAKE = " \ + -DWITH_BUNDLED_DEPS=OFF \ + -DWITH_ADNS=ON \ +" + +do_install_append() { + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service + + install -d ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@BASE_SBINDIR@,${base_sbindir},g' \ + -e 's,@LOCALSTATEDIR@,${localstatedir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${D}${sysconfdir}/init.d/mosquitto +} + +PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients" + +PACKAGE_BEFORE_PN = "${PN}-examples" + +FILES_${PN} = "${sbindir}/mosquitto \ + ${bindir}/mosquitto_passwd \ + ${sysconfdir}/mosquitto \ + ${sysconfdir}/init.d \ + ${systemd_unitdir}/system/mosquitto.service \ +" + +CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf" + +FILES_libmosquitto1 = "${libdir}/libmosquitto.so.*" + +FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.*" + +FILES_${PN}-clients = "${bindir}/mosquitto_pub \ + ${bindir}/mosquitto_sub \ + ${bindir}/mosquitto_rr \ +" + +FILES_${PN}-examples = "${sysconfdir}/mosquitto/*.example" + +SYSTEMD_SERVICE_${PN} = "mosquitto.service" + +INITSCRIPT_NAME = "mosquitto" +INITSCRIPT_PARAMS = "defaults 30" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \ + --user-group mosquitto" diff --git a/recipes-connectivity/mosquitto/mosquitto_1.6.10.bbappend b/recipes-connectivity/mosquitto/mosquitto_1.6.14.bbappend index a03e26e..76906f7 100644 --- a/recipes-connectivity/mosquitto/mosquitto_1.6.10.bbappend +++ b/recipes-connectivity/mosquitto/mosquitto_1.6.14.bbappend @@ -1,4 +1,4 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-mlinux:" SRC_URI += "file://mosquitto.conf \ file://mosquitto.default \ diff --git a/recipes-core/procps/procps/pgrep.patch b/recipes-core/procps/procps/pgrep.patch new file mode 100644 index 0000000..57a9346 --- /dev/null +++ b/recipes-core/procps/procps/pgrep.patch @@ -0,0 +1,60 @@ +From bb96fc42956c9ed926a1b958ab715f8b4a663dec Mon Sep 17 00:00:00 2001 +From: Craig Small <csmall@dropbear.xyz> +Date: Sun, 5 Jan 2020 15:05:55 +1100 +Subject: [PATCH] pgrep: check sanity of SC_ARG_MAX + +A kernel change means we cannot trust what sysconf(SC_ARG_MAX) +returns. We clamp it so its more than 4096 and less than 128*1024 +which is what findutils does. + +References: + procps-ng/procps#152 + https://git.savannah.gnu.org/cgit/findutils.git/tree/lib/buildcmd.c#n535 + https://lwn.net/Articles/727862/ +--- + pgrep.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/pgrep.c b/pgrep.c +index 01563db..bde7448 100644 +--- a/pgrep.c ++++ b/pgrep.c +@@ -485,6 +485,26 @@ static regex_t * do_regcomp (void) + return preg; + } + ++/* ++ * SC_ARG_MAX used to return the maximum size a command line can be ++ * however changes to the kernel mean this can be bigger than we can ++ * alloc. Clamp it to 128kB like xargs and friends do ++ * Should also not be smaller than POSIX_ARG_MAX which is 4096 ++ */ ++static size_t get_arg_max(void) ++{ ++#define MIN_ARG_SIZE 4096u ++#define MAX_ARG_SIZE (128u * 1024u) ++ ++ size_t val = sysconf(_SC_ARG_MAX); ++ ++ if (val < MIN_ARG_SIZE) ++ val = MIN_ARG_SIZE; ++ if (val > MAX_ARG_SIZE) ++ val = MAX_ARG_SIZE; ++ ++ return val; ++} + static struct el * select_procs (int *num) + { + PROCTAB *ptp; +@@ -497,7 +517,7 @@ static struct el * select_procs (int *num) + regex_t *preg; + pid_t myself = getpid(); + struct el *list = NULL; +- long cmdlen = sysconf(_SC_ARG_MAX) * sizeof(char); ++ long cmdlen = get_arg_max() * sizeof(char); + char *cmdline = xmalloc(cmdlen); + char *cmdsearch = xmalloc(cmdlen); + char *cmdoutput = xmalloc(cmdlen); +-- +2.26.2 + diff --git a/recipes-core/procps/procps_%.bbappend b/recipes-core/procps/procps_%.bbappend new file mode 100644 index 0000000..b08f817 --- /dev/null +++ b/recipes-core/procps/procps_%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://pgrep.patch \ + " |