summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-networking/recipes-protocols/net-snmp
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-protocols/net-snmp')
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.1.bb (renamed from meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb)53
2 files changed, 40 insertions, 32 deletions
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch
index da6d80ef4..022eb958f 100644
--- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch
@@ -1,6 +1,6 @@
-From b6a3d6c8af35f1ef27b80b0516742fce89f4eb29 Mon Sep 17 00:00:00 2001
-From: Marian Florea <marian.florea@windriver.com>
-Date: Thu, 20 Jul 2017 16:55:24 +0800
+From 1e3178835217ba89aa355e2b6b88e490f17be16d Mon Sep 17 00:00:00 2001
+From: Zheng Ruoqin <zhengrq.fnst@fujitsu.com>
+Date: Wed, 9 Jun 2021 15:47:30 +0900
Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP
Upstream-Status: Pending
@@ -14,17 +14,17 @@ Signed-off-by: Li Zhou <li.zhou@windriver.com>
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/agent/snmpd.c b/agent/snmpd.c
-index ae73eda..66b4560 100644
+index 1af439f..355b510 100644
--- a/agent/snmpd.c
+++ b/agent/snmpd.c
-@@ -1207,6 +1207,7 @@ receive(void)
+@@ -1208,6 +1208,7 @@ receive(void)
snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n",
netsnmp_get_version());
update_config();
-+ snmp_store(app_name);
++ snmp_store(app_name);
send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3);
- #if HAVE_SIGHOLD
- sigrelse(SIGHUP);
+ #if HAVE_SIGPROCMASK
+ ret = sigprocmask(SIG_UNBLOCK, &set, NULL);
diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c
index 29c2a0f..ada961c 100644
--- a/snmplib/snmpv3.c
@@ -41,3 +41,6 @@ index 29c2a0f..ada961c 100644
engineBoots = 1;
}
+--
+2.25.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.1.bb
index de0aeeec7..ed7f8428b 100644
--- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.1.bb
@@ -5,7 +5,8 @@ LICENSE = "BSD & MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687"
-DEPENDS = "openssl libnl pciutils"
+DEPENDS = "openssl"
+DEPENDS_append_class-target = " pciutils"
SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
file://init \
@@ -27,7 +28,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
file://reproducibility-have-printcap.patch \
file://0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch \
"
-SRC_URI[sha256sum] = "04303a66f85d6d8b16d3cc53bde50428877c82ab524e17591dfceaeb94df6071"
+SRC_URI[sha256sum] = "eb7fd4a44de6cddbffd9a92a85ad1309e5c1054fb9d5a7dd93079c8953f48c3f"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/"
UPSTREAM_CHECK_REGEX = "/net-snmp/(?P<pver>\d+(\.\d+)+)/"
@@ -41,24 +42,23 @@ CCACHE = ""
TARGET_CC_ARCH += "${LDFLAGS}"
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} des smux"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} des smux"
+PACKAGECONFIG[des] = "--enable-des, --disable-des"
PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils"
+PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl"
-
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
-
-PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no,\
- perl,"
-PACKAGECONFIG[des] = "--enable-des,--disable-des"
+PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no, perl"
PACKAGECONFIG[smux] = ""
-
-EXTRA_OECONF = "--enable-shared \
- --disable-manuals \
- --with-defaults \
- --with-install-prefix=${D} \
- --with-persistent-directory=${localstatedir}/lib/net-snmp \
- ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
- --with-mib-modules='${MIB_MODULES}' \
+PACKAGECONFIG[systemd] = "--with-systemd, --without-systemd"
+
+EXTRA_OECONF = " \
+ --enable-shared \
+ --disable-manuals \
+ --with-defaults \
+ --with-install-prefix=${D} \
+ --with-persistent-directory=${localstatedir}/lib/net-snmp \
+ --with-endianness=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
+ --with-mib-modules='${MIB_MODULES}' \
"
MIB_MODULES = ""
@@ -73,8 +73,10 @@ CACHED_CONFIGUREVARS = " \
ac_cv_file__etc_printcap=no \
NETSNMP_CONFIGURE_OPTIONS= \
"
-export PERLPROG="${bindir}/env perl"
+PERLPROG = "${bindir}/env perl"
+PERLPROG_class-native = "${bindir_native}/env perl"
PERLPROG_append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}"
+export PERLPROG
HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}"
@@ -117,7 +119,7 @@ do_install_append() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
- sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
+ sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
-i ${D}${bindir}/net-snmp-create-v3-user
sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \
-e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \
@@ -128,11 +130,14 @@ do_install_append() {
-e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
-e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
-e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
- -e 's@${STAGING_DIR_HOST}@@g' \
-i ${D}${bindir}/net-snmp-config
- sed -e 's@${STAGING_DIR_HOST}@@g' \
- -i ${D}${libdir}/pkgconfig/netsnmp*.pc
+ # ${STAGING_DIR_HOST} is empty for native builds, and the sed command below
+ # will result in errors if run for native.
+ if [ "${STAGING_DIR_HOST}" ]; then
+ sed -e 's@${STAGING_DIR_HOST}@@g' \
+ -i ${D}${bindir}/net-snmp-config ${D}${libdir}/pkgconfig/netsnmp*.pc
+ fi
sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \
-e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
@@ -234,8 +239,6 @@ INITSCRIPT_PACKAGES = "${PN}-server-snmpd"
INITSCRIPT_NAME_${PN}-server-snmpd = "snmpd"
INITSCRIPT_PARAMS_${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ."
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}"
-
SYSTEMD_PACKAGES = "${PN}-server-snmpd \
${PN}-server-snmptrapd"
@@ -275,3 +278,5 @@ RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
LEAD_SONAME = "libnetsnmp.so"
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config"
+
+BBCLASSEXTEND = "native"