From 014b90ee43b0b74086b4da3e3c9fcd0a5ecd830d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 17 Dec 2018 18:18:37 -0800 Subject: collectd: Upgrade to 5.8.1 release Fix build with gcc9 Signed-off-by: Khem Raj --- .../collectd/0005-Disable-new-gcc8-warnings.patch | 18 ++--- ...collectdclient-Fix-string-overflow-errors.patch | 31 ++++++++ .../recipes-extended/collectd/collectd_5.8.0.bb | 87 --------------------- .../recipes-extended/collectd/collectd_5.8.1.bb | 88 ++++++++++++++++++++++ 4 files changed, 128 insertions(+), 96 deletions(-) create mode 100644 meta-oe/recipes-extended/collectd/collectd/0006-libcollectdclient-Fix-string-overflow-errors.patch delete mode 100644 meta-oe/recipes-extended/collectd/collectd_5.8.0.bb create mode 100644 meta-oe/recipes-extended/collectd/collectd_5.8.1.bb (limited to 'meta-oe') diff --git a/meta-oe/recipes-extended/collectd/collectd/0005-Disable-new-gcc8-warnings.patch b/meta-oe/recipes-extended/collectd/collectd/0005-Disable-new-gcc8-warnings.patch index b12690b327..13510cdea0 100644 --- a/meta-oe/recipes-extended/collectd/collectd/0005-Disable-new-gcc8-warnings.patch +++ b/meta-oe/recipes-extended/collectd/collectd/0005-Disable-new-gcc8-warnings.patch @@ -1,4 +1,4 @@ -From d65e48b68076d5b304e6d865967003ae1fea0e6c Mon Sep 17 00:00:00 2001 +From f82f8faf9942f51e9c3c773b56574652695bef5a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 9 May 2018 21:45:38 -0700 Subject: [PATCH] Disable new gcc8 warnings @@ -7,17 +7,17 @@ GCC seems to be not able to detect the checks for size are already in place Signed-off-by: Khem Raj + --- -Upstream-Status: Submitted [https://github.com/collectd/collectd/pull/2768] src/libcollectdclient/network_parse.c | 7 +++++++ src/write_sensu.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c -index 2365ab0a..79e6ed96 100644 +index aa753ce..fef43a9 100644 --- a/src/libcollectdclient/network_parse.c +++ b/src/libcollectdclient/network_parse.c -@@ -163,6 +163,11 @@ static int parse_int(void *payload, size_t payload_size, uint64_t *out) { +@@ -148,6 +148,11 @@ static int parse_int(void *payload, size_t payload_size, uint64_t *out) { return 0; } @@ -29,7 +29,7 @@ index 2365ab0a..79e6ed96 100644 static int parse_string(void *payload, size_t payload_size, char *out, size_t out_size) { char *in = payload; -@@ -175,6 +180,8 @@ static int parse_string(void *payload, size_t payload_size, char *out, +@@ -160,6 +165,8 @@ static int parse_string(void *payload, size_t payload_size, char *out, return 0; } @@ -39,22 +39,22 @@ index 2365ab0a..79e6ed96 100644 lcc_value_list_t *state) { char buf[LCC_NAME_LEN]; diff --git a/src/write_sensu.c b/src/write_sensu.c -index ce23e654..63e1f599 100644 +index bd7a56d..6cb59d5 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c -@@ -569,6 +569,11 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */ +@@ -570,6 +570,11 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */ return ret_str; } /* }}} char *sensu_value_to_json */ +#pragma GCC diagnostic push -+#if __GNUC__ == 8 ++#if __GNUC__ > 7 +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif /* * Uses replace_str2() implementation from * http://creativeandcritical.net/str-replace-c/ -@@ -631,6 +636,8 @@ static char *replace_str(const char *str, const char *old, /* {{{ */ +@@ -632,6 +637,8 @@ static char *replace_str(const char *str, const char *old, /* {{{ */ return ret; } /* }}} char *replace_str */ diff --git a/meta-oe/recipes-extended/collectd/collectd/0006-libcollectdclient-Fix-string-overflow-errors.patch b/meta-oe/recipes-extended/collectd/collectd/0006-libcollectdclient-Fix-string-overflow-errors.patch new file mode 100644 index 0000000000..3ed652f71f --- /dev/null +++ b/meta-oe/recipes-extended/collectd/collectd/0006-libcollectdclient-Fix-string-overflow-errors.patch @@ -0,0 +1,31 @@ +From 98719ea7f717750c790a1f9384ea8d0117e7f52d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 17 Dec 2018 18:15:05 -0800 +Subject: [PATCH] libcollectdclient: Fix string overflow errors + +Ensure that string has a space for ending null char + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + src/libcollectdclient/network_parse.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c +index fef43a9..6d65266 100644 +--- a/src/libcollectdclient/network_parse.c ++++ b/src/libcollectdclient/network_parse.c +@@ -169,9 +169,9 @@ static int parse_string(void *payload, size_t payload_size, char *out, + + static int parse_identifier(uint16_t type, void *payload, size_t payload_size, + lcc_value_list_t *state) { +- char buf[LCC_NAME_LEN]; +- +- if (parse_string(payload, payload_size, buf, sizeof(buf)) != 0) ++ char buf[LCC_NAME_LEN+1]; ++ buf[LCC_NAME_LEN] = '\0'; ++ if (parse_string(payload, payload_size, buf, LCC_NAME_LEN) != 0) + return EINVAL; + + switch (type) { diff --git a/meta-oe/recipes-extended/collectd/collectd_5.8.0.bb b/meta-oe/recipes-extended/collectd/collectd_5.8.0.bb deleted file mode 100644 index df9fa233cd..0000000000 --- a/meta-oe/recipes-extended/collectd/collectd_5.8.0.bb +++ /dev/null @@ -1,87 +0,0 @@ -SUMMARY = "Collects and summarises system performance statistics" -DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files." -LICENSE = "GPLv2 & MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854" - -DEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2" - -SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \ - file://collectd.init \ - file://collectd.service \ - file://no-gcrypt-badpath.patch \ - file://0001-conditionally-check-libvirt.patch \ - file://0001-fix-to-build-with-glibc-2.25.patch \ - file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \ - file://0005-Disable-new-gcc8-warnings.patch \ - " -SRC_URI[md5sum] = "a841159323624f18bf03198e9f5aa364" -SRC_URI[sha256sum] = "b06ff476bbf05533cb97ae6749262cc3c76c9969f032bd8496690084ddeb15c9" - -inherit autotools pythonnative update-rc.d pkgconfig systemd - -SYSTEMD_SERVICE_${PN} = "collectd.service" - -# Floatingpoint layout, architecture dependent -# 'nothing', 'endianflip' or 'intswap' -FPLAYOUT ?= "--with-fp-layout=nothing" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7" -PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp" -PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached" -PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables" -PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \ - --disable-postgresql --with-libpq=no,postgresql" -PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \ - --disable-mysql --with-libmysql=no,mysql5" -PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi" -PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus" -PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs" -PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \ - --disable-sensors --with-libsensors=no,lmsensors" -PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \ - --disable-amqp --with-librabbitmq=no,rabbitmq-c" -# protobuf-c, libvirt that are currently only available in meta-virtualization layer -PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c" -PACKAGECONFIG[libvirt] = "--enable-virt,--disable-virt,libvirt" -PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp" -PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl" -PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart" -PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap" - -EXTRA_OECONF = " \ - ${FPLAYOUT} \ - --disable-perl --with-libperl=no --with-perl-bindings=no \ - --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \ - --disable-notify_desktop \ -" - -do_install_append() { - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd - sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd - sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd - sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd - sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd - install -Dm 0640 ${B}/src/collectd.conf ${D}${sysconfdir}/collectd.conf - # Fix configuration file to allow collectd to start up - sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup false!g' ${D}${sysconfdir}/collectd.conf - - rmdir "${D}${localstatedir}/run" - rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" - - # Install systemd unit files - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system - sed -i -e 's,@SBINDIR@,${sbindir},g' \ - ${D}${systemd_unitdir}/system/collectd.service -} - -CONFFILES_${PN} = "${sysconfdir}/collectd.conf" - -INITSCRIPT_NAME = "collectd" -INITSCRIPT_PARAMS = "defaults" - -# threshold.so load.so are also provided by gegl -# disk.so is also provided by libgphoto2-camlibs -PRIVATE_LIBS = "threshold.so load.so disk.so" diff --git a/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb b/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb new file mode 100644 index 0000000000..6dff18c16b --- /dev/null +++ b/meta-oe/recipes-extended/collectd/collectd_5.8.1.bb @@ -0,0 +1,88 @@ +SUMMARY = "Collects and summarises system performance statistics" +DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files." +LICENSE = "GPLv2 & MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854" + +DEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2" + +SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \ + file://collectd.init \ + file://collectd.service \ + file://no-gcrypt-badpath.patch \ + file://0001-conditionally-check-libvirt.patch \ + file://0001-fix-to-build-with-glibc-2.25.patch \ + file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \ + file://0005-Disable-new-gcc8-warnings.patch \ + file://0006-libcollectdclient-Fix-string-overflow-errors.patch \ + " +SRC_URI[md5sum] = "bfce96c42cede5243028510bcc57c1e6" +SRC_URI[sha256sum] = "e796fda27ce06377f491ad91aa286962a68c2b54076aa77a29673d53204453da" + +inherit autotools pythonnative update-rc.d pkgconfig systemd + +SYSTEMD_SERVICE_${PN} = "collectd.service" + +# Floatingpoint layout, architecture dependent +# 'nothing', 'endianflip' or 'intswap' +FPLAYOUT ?= "--with-fp-layout=nothing" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7" +PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp" +PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached" +PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables" +PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \ + --disable-postgresql --with-libpq=no,postgresql" +PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \ + --disable-mysql --with-libmysql=no,mysql5" +PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi" +PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus" +PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs" +PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \ + --disable-sensors --with-libsensors=no,lmsensors" +PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \ + --disable-amqp --with-librabbitmq=no,rabbitmq-c" +# protobuf-c, libvirt that are currently only available in meta-virtualization layer +PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c" +PACKAGECONFIG[libvirt] = "--enable-virt,--disable-virt,libvirt" +PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp" +PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl" +PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart" +PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap" + +EXTRA_OECONF = " \ + ${FPLAYOUT} \ + --disable-perl --with-libperl=no --with-perl-bindings=no \ + --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \ + --disable-notify_desktop \ +" + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd + sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd + sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd + sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd + sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd + install -Dm 0640 ${B}/src/collectd.conf ${D}${sysconfdir}/collectd.conf + # Fix configuration file to allow collectd to start up + sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup false!g' ${D}${sysconfdir}/collectd.conf + + rmdir "${D}${localstatedir}/run" + rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" + + # Install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/collectd.service +} + +CONFFILES_${PN} = "${sysconfdir}/collectd.conf" + +INITSCRIPT_NAME = "collectd" +INITSCRIPT_PARAMS = "defaults" + +# threshold.so load.so are also provided by gegl +# disk.so is also provided by libgphoto2-camlibs +PRIVATE_LIBS = "threshold.so load.so disk.so" -- cgit 1.2.3-korg