Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] mini-snmpd: bump and housekeeping
@ 2026-07-06  4:52 Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 1/3] package/mini-snmpd: bump to version 2.0 Joachim Wiberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joachim Wiberg @ 2026-07-06  4:52 UTC (permalink / raw)
  To: buildroot; +Cc: Alexander Sverdlin, Fiona Klute, Joachim Wiberg

This is a major update of mini-snmpd, see below for links to upstream
relase notes.  The intermediate v1.7 release turned out to be buggy,
so we update to v2.0 directly.

For buildroot, integration with libconfuse and ethtool, as well as an
init script was added, with the benefit of also fixing use in systemd
based systems.

Best regards
 /Joachim

Joachim Wiberg (3):
  package/mini-snmpd: bump to version 2.0
  package/mini-snmpd: add sysv init script
  package/mini-snmpd: enable optional .conf and ethtool support

 .../0001-linux.c-fix-musl-build.patch         | 46 ----------------
 package/mini-snmpd/Config.in                  | 17 +++++-
 package/mini-snmpd/S60mini-snmpd              | 52 +++++++++++++++++++
 package/mini-snmpd/mini-snmpd                 |  2 +-
 package/mini-snmpd/mini-snmpd.conf            | 36 +++++++++++++
 package/mini-snmpd/mini-snmpd.hash            |  3 +-
 package/mini-snmpd/mini-snmpd.mk              | 29 +++++++++--
 7 files changed, 133 insertions(+), 52 deletions(-)
 delete mode 100644 package/mini-snmpd/0001-linux.c-fix-musl-build.patch
 create mode 100644 package/mini-snmpd/S60mini-snmpd
 create mode 100644 package/mini-snmpd/mini-snmpd.conf

-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/3] package/mini-snmpd: bump to version 2.0
  2026-07-06  4:52 [Buildroot] [PATCH 0/3] mini-snmpd: bump and housekeeping Joachim Wiberg
@ 2026-07-06  4:52 ` Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 2/3] package/mini-snmpd: add sysv init script Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 3/3] package/mini-snmpd: enable optional .conf and ethtool support Joachim Wiberg
  2 siblings, 0 replies; 4+ messages in thread
From: Joachim Wiberg @ 2026-07-06  4:52 UTC (permalink / raw)
  To: buildroot; +Cc: Alexander Sverdlin, Fiona Klute, Joachim Wiberg

This bumps from v1.6 directly to v2.0, for details, please see:

 - https://github.com/troglobit/mini-snmpd/releases/tag/v1.7
 - https://github.com/troglobit/mini-snmpd/releases/tag/v2.0

The release tarball is the canonical supported source for the project
and also ships a pre-generated configure script, hence the switch.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
 .../0001-linux.c-fix-musl-build.patch         | 46 -------------------
 package/mini-snmpd/mini-snmpd.hash            |  3 +-
 package/mini-snmpd/mini-snmpd.mk              |  5 +-
 3 files changed, 4 insertions(+), 50 deletions(-)
 delete mode 100644 package/mini-snmpd/0001-linux.c-fix-musl-build.patch

diff --git a/package/mini-snmpd/0001-linux.c-fix-musl-build.patch b/package/mini-snmpd/0001-linux.c-fix-musl-build.patch
deleted file mode 100644
index 8e8bb090fd..0000000000
--- a/package/mini-snmpd/0001-linux.c-fix-musl-build.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 73fa408f51ec25121075aaccac9c9db1c68567cd Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Thu, 12 Mar 2020 10:02:18 +0100
-Subject: [PATCH] linux.c: fix musl build
-
-Remove include on linux/if_link.h to avoid the following build failure
-with musl:
-
-In file included from /home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:4,
-                 from /home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:4,
-                 from /home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/if_link.h:5,
-                 from linux.c:21:
-/home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:7:8: error: redefinition of 'struct sysinfo'
- struct sysinfo {
-        ^~~~~~~
-In file included from linux.c:19:
-/home/buildroot/autobuild/instance-2/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here
- struct sysinfo {
-        ^~~~~~~
-  CC       mini_snmpd-globals.o
-
-Fixes:
- - http://autobuild.buildroot.org/results/6903a0f685076b4a2c2824de6158da40e9e712d8
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Retrieved from:
-https://github.com/troglobit/mini-snmpd/commit/73fa408f51ec25121075aaccac9c9db1c68567cd]
----
- linux.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/linux.c b/linux.c
-index a657912..86a7085 100644
---- a/linux.c
-+++ b/linux.c
-@@ -18,7 +18,6 @@
- #include <netpacket/packet.h>
- #include <sys/sysinfo.h>
- #include <sys/socket.h>
--#include <linux/if_link.h>
- #include <sys/ioctl.h>
- #include <sys/types.h>
- #include <sys/time.h>
--- 
-2.25.1
-
diff --git a/package/mini-snmpd/mini-snmpd.hash b/package/mini-snmpd/mini-snmpd.hash
index fee76c07a3..d1e8f51f8e 100644
--- a/package/mini-snmpd/mini-snmpd.hash
+++ b/package/mini-snmpd/mini-snmpd.hash
@@ -1,3 +1,4 @@
+# sha256 from https://github.com/troglobit/mini-snmpd/releases/tag/v2.0
+sha256  851acf49a1a36356664af0a7a040fa31f75403eb26e03627eba188ee15d4854c  mini-snmpd-2.0.tar.gz
 # Locally calculated
-sha256  de00c475a3c70c56f3ee97cd683cb71009d3521d60b1f589c5a91b4671ede9f3  mini-snmpd-1.6.tar.gz
 sha256  8a43b895972a24567297f44f35dab0f5f9ed3b7db6dac0bf6094075b27ab9d56  COPYING
diff --git a/package/mini-snmpd/mini-snmpd.mk b/package/mini-snmpd/mini-snmpd.mk
index 1f6e5c1919..89eca4ce79 100644
--- a/package/mini-snmpd/mini-snmpd.mk
+++ b/package/mini-snmpd/mini-snmpd.mk
@@ -4,13 +4,12 @@
 #
 ################################################################################
 
-MINI_SNMPD_VERSION = 1.6
-MINI_SNMPD_SITE = $(call github,troglobit,mini-snmpd,v$(MINI_SNMPD_VERSION))
+MINI_SNMPD_VERSION = 2.0
+MINI_SNMPD_SITE = https://github.com/troglobit/mini-snmpd/releases/download/v$(MINI_SNMPD_VERSION)
 MINI_SNMPD_LICENSE = GPL-2.0
 MINI_SNMPD_LICENSE_FILES = COPYING
 MINI_SNMPD_CPE_ID_VENDOR = minisnmpd_project
 MINI_SNMPD_CPE_ID_PRODUCT = minisnmpd
-MINI_SNMPD_AUTORECONF = YES
 MINI_SNMPD_DEPENDENCIES = host-pkgconf
 
 define MINI_SNMPD_INSTALL_ETC_DEFAULT
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/3] package/mini-snmpd: add sysv init script
  2026-07-06  4:52 [Buildroot] [PATCH 0/3] mini-snmpd: bump and housekeeping Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 1/3] package/mini-snmpd: bump to version 2.0 Joachim Wiberg
@ 2026-07-06  4:52 ` Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 3/3] package/mini-snmpd: enable optional .conf and ethtool support Joachim Wiberg
  2 siblings, 0 replies; 4+ messages in thread
From: Joachim Wiberg @ 2026-07-06  4:52 UTC (permalink / raw)
  To: buildroot; +Cc: Alexander Sverdlin, Fiona Klute, Joachim Wiberg

A start script has been missing since the package was added, so the
daemon was not started automatically on sysv/busybox systems.

This also fixes a regression in systemd builds introduced in fccdc6bd,
when the package switched from local unit file to upstream.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
 package/mini-snmpd/S60mini-snmpd | 52 ++++++++++++++++++++++++++++++++
 package/mini-snmpd/mini-snmpd    |  2 +-
 package/mini-snmpd/mini-snmpd.mk |  5 +++
 3 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 package/mini-snmpd/S60mini-snmpd

diff --git a/package/mini-snmpd/S60mini-snmpd b/package/mini-snmpd/S60mini-snmpd
new file mode 100644
index 0000000000..e7c61d7a85
--- /dev/null
+++ b/package/mini-snmpd/S60mini-snmpd
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+DAEMON="mini-snmpd"
+PIDFILE="/var/run/$DAEMON.pid"
+
+DAEMON_OPTS=""
+
+# shellcheck source=/dev/null
+[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
+
+start() {
+	printf 'Starting %s: ' "$DAEMON"
+	# shellcheck disable=SC2086 # we need the word splitting
+	start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
+		--exec "/usr/sbin/$DAEMON" -- $DAEMON_OPTS
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
+stop() {
+	printf 'Stopping %s: ' "$DAEMON"
+	start-stop-daemon --stop --quiet --pidfile "$PIDFILE" \
+		--exec "/usr/sbin/$DAEMON"
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+	start|stop|restart)
+		"$1";;
+	reload)
+		# Restart, since there is no true "reload" feature.
+		restart;;
+	*)
+		echo "Usage: $0 {start|stop|restart|reload}"
+		exit 1
+esac
diff --git a/package/mini-snmpd/mini-snmpd b/package/mini-snmpd/mini-snmpd
index 0ca9901d58..371f57f15f 100644
--- a/package/mini-snmpd/mini-snmpd
+++ b/package/mini-snmpd/mini-snmpd
@@ -1,2 +1,2 @@
 # Require client authentication, thus SNMP version 2c
-EXTRA_PARAMS=-a
+DAEMON_OPTS="-a -c public -s"
diff --git a/package/mini-snmpd/mini-snmpd.mk b/package/mini-snmpd/mini-snmpd.mk
index 89eca4ce79..99bef47477 100644
--- a/package/mini-snmpd/mini-snmpd.mk
+++ b/package/mini-snmpd/mini-snmpd.mk
@@ -19,4 +19,9 @@ endef
 
 MINI_SNMPD_POST_INSTALL_TARGET_HOOKS += MINI_SNMPD_INSTALL_ETC_DEFAULT
 
+define MINI_SNMPD_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/mini-snmpd/S60mini-snmpd \
+		$(TARGET_DIR)/etc/init.d/S60mini-snmpd
+endef
+
 $(eval $(autotools-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 3/3] package/mini-snmpd: enable optional .conf and ethtool support
  2026-07-06  4:52 [Buildroot] [PATCH 0/3] mini-snmpd: bump and housekeeping Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 1/3] package/mini-snmpd: bump to version 2.0 Joachim Wiberg
  2026-07-06  4:52 ` [Buildroot] [PATCH 2/3] package/mini-snmpd: add sysv init script Joachim Wiberg
@ 2026-07-06  4:52 ` Joachim Wiberg
  2 siblings, 0 replies; 4+ messages in thread
From: Joachim Wiberg @ 2026-07-06  4:52 UTC (permalink / raw)
  To: buildroot; +Cc: Alexander Sverdlin, Fiona Klute, Joachim Wiberg

Both libConfuse and ethtool support is relatively new features.  Enable
optional support for them, including an example /etc/mini-snmpd.conf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
 package/mini-snmpd/Config.in       | 17 +++++++++++++-
 package/mini-snmpd/mini-snmpd.conf | 36 ++++++++++++++++++++++++++++++
 package/mini-snmpd/mini-snmpd.mk   | 19 ++++++++++++++++
 3 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 package/mini-snmpd/mini-snmpd.conf

diff --git a/package/mini-snmpd/Config.in b/package/mini-snmpd/Config.in
index 1f61cddbcf..de83944528 100644
--- a/package/mini-snmpd/Config.in
+++ b/package/mini-snmpd/Config.in
@@ -4,4 +4,19 @@ config BR2_PACKAGE_MINI_SNMPD
 	  Mini SNMPd is a minimal implementation targeted at small or
 	  embedded UNIX systems with limited resources
 
-	  http://troglobit.com/mini-snmpd.html
+	  Enable BR2_PACKAGE_LIBCONFUSE for /etc/mini-snmpd.conf support
+	  with an example file.  Also enabling BR2_PACKAGE_ETHTOOL adds
+	  ethtool-based interface statistics.
+
+	  https://troglobit.com/mini-snmpd.html
+
+if BR2_PACKAGE_MINI_SNMPD
+
+config BR2_PACKAGE_MINI_SNMPD_INTERFACES
+	int "Number of network interfaces"
+	default 8
+	range 1 256
+	help
+	  Max number of network interfaces exposed in IF-MIB::ifTable
+
+endif
diff --git a/package/mini-snmpd/mini-snmpd.conf b/package/mini-snmpd/mini-snmpd.conf
new file mode 100644
index 0000000000..4679a8e43d
--- /dev/null
+++ b/package/mini-snmpd/mini-snmpd.conf
@@ -0,0 +1,36 @@
+# Require client authentication (SNMP v2c)
+authentication = true
+community      = "public"
+
+# Descriptive MIB-II system.* values, shown by snmpwalk
+#location      = "Server room, rack 4"
+#contact       = "ops@example.com"
+#description   = "Acme Gateway 3000"
+
+# Vendor OID tree (enterprises.*)
+#vendor        = ".1.3.6.1.4.1"
+
+# MIB poll timeout, seconds
+#timeout       = 1
+
+# Mount points to expose in UCD-SNMP-MIB::dskTable
+#disk-table    = { "/", "/var" }
+
+# Interfaces to expose in IF-MIB::ifTable
+#iface-table   = { "eth0", "eth1" }
+
+# SNMPv2 trap sinks
+#trap-table    = { "192.0.2.1", "[2001:db8::1]:1620" }
+
+# Emulate the respons of another device
+# custom ".1.3.6.1.4.1.11.2.3.9.1.1.7.0" {
+#    value = "MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CLS:PRINTER;"
+#}
+
+# Map ethtool stats to IF-MIB counters:
+#ethtool "eth*" {
+#    rx_bytes   = ifInOctets
+#    rx_packets = ifInUcastPkts
+#    tx_bytes   = ifOutOctets
+#    tx_packets = ifOutUcastPkts
+#}
diff --git a/package/mini-snmpd/mini-snmpd.mk b/package/mini-snmpd/mini-snmpd.mk
index 99bef47477..9873ad2dee 100644
--- a/package/mini-snmpd/mini-snmpd.mk
+++ b/package/mini-snmpd/mini-snmpd.mk
@@ -11,6 +11,25 @@ MINI_SNMPD_LICENSE_FILES = COPYING
 MINI_SNMPD_CPE_ID_VENDOR = minisnmpd_project
 MINI_SNMPD_CPE_ID_PRODUCT = minisnmpd
 MINI_SNMPD_DEPENDENCIES = host-pkgconf
+MINI_SNMPD_CONF_OPTS = --with-interfaces=$(BR2_PACKAGE_MINI_SNMPD_INTERFACES)
+
+ifeq ($(BR2_PACKAGE_LIBCONFUSE),y)
+MINI_SNMPD_DEPENDENCIES += libconfuse
+MINI_SNMPD_CONF_OPTS += --with-config
+# ethtool interface stats live in linux_ethtool.c, only built with libConfuse
+ifeq ($(BR2_PACKAGE_ETHTOOL),y)
+MINI_SNMPD_CONF_OPTS += --enable-ethtool
+else
+MINI_SNMPD_CONF_OPTS += --disable-ethtool
+endif
+define MINI_SNMPD_INSTALL_CONFIG
+	$(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd.conf \
+		$(TARGET_DIR)/etc/mini-snmpd.conf
+endef
+MINI_SNMPD_POST_INSTALL_TARGET_HOOKS += MINI_SNMPD_INSTALL_CONFIG
+else
+MINI_SNMPD_CONF_OPTS += --without-config
+endif
 
 define MINI_SNMPD_INSTALL_ETC_DEFAULT
 	$(INSTALL) -D -m 644 package/mini-snmpd/mini-snmpd \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-06  4:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  4:52 [Buildroot] [PATCH 0/3] mini-snmpd: bump and housekeeping Joachim Wiberg
2026-07-06  4:52 ` [Buildroot] [PATCH 1/3] package/mini-snmpd: bump to version 2.0 Joachim Wiberg
2026-07-06  4:52 ` [Buildroot] [PATCH 2/3] package/mini-snmpd: add sysv init script Joachim Wiberg
2026-07-06  4:52 ` [Buildroot] [PATCH 3/3] package/mini-snmpd: enable optional .conf and ethtool support Joachim Wiberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox