Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
From 6facf270a6b9850846f015e64b8347319069fd57 Mon Sep 17 00:00:00 2001
From: Wes Hardaker <opensource@hardakers.net>
Date: Mon, 29 Dec 2025 13:38:59 -0800
Subject: [PATCH] moving -Werror=declaration-after-statement to only for
developers
Upstream: https://github.com/net-snmp/net-snmp/commit/0f19435ecc8fd6c3ef9cf2a391bd7bca25539e80
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
configure.d/config_os_progs | 39 +++++++++++++++++++------------------
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/configure.d/config_os_progs b/configure.d/config_os_progs
index b3ecf556cc..b029de6017 100644
--- a/configure.d/config_os_progs
+++ b/configure.d/config_os_progs
@@ -110,24 +110,6 @@ AC_SUBST(LIBTOOL_DEPS)
# Build environment:
##
-for opt in -Werror=declaration-after-statement
-do
- AC_MSG_CHECKING([whether the compiler supports $opt])
- netsnmp_save_CFLAGS="$CFLAGS"
- if test x$opt != x-Wstrict-prototypes; then
- CFLAGS="-Werror $opt $CFLAGS"
- else
- CFLAGS="$opt $CFLAGS"
- fi
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
- AC_MSG_RESULT([yes])
- CFLAGS="$opt $netsnmp_save_CFLAGS"
- ], [
- AC_MSG_RESULT([no])
- CFLAGS="$netsnmp_save_CFLAGS"
- ])
-done
-
# developer build
# (enabled by default when building from SVN checkout)
#
@@ -135,7 +117,7 @@ if test "x$developer" != "xno" -a -f $srcdir/remove-files; then
developer="yes"
fi
if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
- AC_MSG_CHECKING([for developer gcc flags])
+ AC_MSG_NOTICE([Checking for developer compiler flags])
# WWWXXX - strict type checking
#
netsnmp_save_CFLAGS="$CFLAGS"
@@ -159,6 +141,25 @@ if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
CFLAGS="$netsnmp_save_CFLAGS"
done
AC_MSG_RESULT($DEVFLAGS)
+
+ for opt in -Werror=declaration-after-statement
+ do
+ AC_MSG_CHECKING([whether the compiler supports $opt])
+ netsnmp_save_CFLAGS="$CFLAGS"
+ if test x$opt != x-Wstrict-prototypes; then
+ CFLAGS="-Werror $opt $CFLAGS"
+ else
+ CFLAGS="$opt $CFLAGS"
+ fi
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
+ AC_MSG_RESULT([yes])
+ CFLAGS="$opt $netsnmp_save_CFLAGS"
+ ], [
+ AC_MSG_RESULT([no])
+ CFLAGS="$netsnmp_save_CFLAGS"
+ ])
+ done
+
else
DEVFLAGS=""
fi
--
2.47.3

61
package/netsnmp/Config.in Normal file
View File

@@ -0,0 +1,61 @@
config BR2_PACKAGE_NETSNMP
bool "netsnmp"
depends on BR2_USE_MMU # fork()
select BR2_PACKAGE_LIBOPENSSL_ENABLE_DES if BR2_PACKAGE_LIBOPENSSL
help
Suite of applications used to implement SNMP v1, SNMP v2c, and
SNMP v3 using both IPv4 and IPv6.
http://net-snmp.sourceforge.net/
if BR2_PACKAGE_NETSNMP
config BR2_PACKAGE_NETSNMP_SERVER
bool "server"
default y
help
The snmpd server.
config BR2_PACKAGE_NETSNMP_CLIENTS
bool "clients"
default y
help
The net-snmp clients (snmpget, snmpwalk, etc).
config BR2_PACKAGE_NETSNMP_ENABLE_MIBS
bool "Install MIB files on target and enable MIB loading code"
default y
help
The net-snmp package contains a selection of MIB files.
Say yes if you want those MIB files installed on the target
and enable the code that parses the MIB files.
config BR2_PACKAGE_NETSNMP_WITH_MIB_MODULES
string "Build with these MIB modules"
default "host ucd-snmp/dlmod agentx" if !BR2_STATIC_LIBS
default "host agentx" if BR2_STATIC_LIBS
help
Specify which MIB modules to include.
config BR2_PACKAGE_NETSNMP_WITHOUT_MIB_MODULES
string "Build without these MIB modules"
default "disman/event disman/schedule utilities"
help
Specify which MIB modules to exclude.
config BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING
bool "Enable debugging code"
help
By default net-snmp is compiled without debugging support
(--disable-debugging). Enable this options if you need
debugging support, including the ability to log with
DEBUGMSG(), DEBUGMSGTL() and companion macros.
config BR2_PACKAGE_NETSNMP_OPENSSL_INTERNAL
bool "Enable minimal internal OpenSSL code"
depends on !BR2_PACKAGE_OPENSSL
help
Enable a minimal internal copy of OpenSSL usable for USM
security. It will not enable the usage of SNMP over (D)TLS.
endif

104
package/netsnmp/S59snmpd Normal file
View File

@@ -0,0 +1,104 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: snmpd snmptrapd
# Required-Start: $network $local_fs
# Required-Stop: $network $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 6
# Short-Description: SNMP agents
# Description: NET SNMP (Simple Network Management Protocol) Agents
### END INIT INFO
#
# Author: Jochen Friedrich <jochen@scram.de>
#
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
# Defaults
export MIBDIRS=/usr/share/snmp/mibs
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid -u snmp -g snmp 127.0.0.1'
TRAPDRUN=no
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
# Reads config file (will override defaults above)
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
ssd_oknodo="-o"
# Cd to / before starting any daemons.
cd /
# Create compatibility link to old AgentX socket location
if [ "$SNMPDCOMPAT" = "yes" ]; then
ln -sf /var/agentx/master /var/run/agentx
fi
start() {
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
printf "Starting SNMP daemon: "
start-stop-daemon -q -S -x /usr/sbin/snmpd -- $SNMPDOPTS
[ $? = 0 ] && echo "OK" || echo "FAIL"
fi
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then
printf "Starting SNMP trap daemon: "
start-stop-daemon -q -S -x /usr/sbin/snmptrapd -- $TRAPDOPTS
[ $? = 0 ] && echo "OK" || echo "FAIL"
fi
}
stop() {
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
printf "Stopping SNMP daemon: "
start-stop-daemon -q -K $ssd_oknodo -x /usr/sbin/snmpd
[ $? = 0 ] && echo "OK" || echo "FAIL"
fi
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then
printf "Stopping SNMP trap daemon: "
start-stop-daemon -q -K $ssd_oknodo -x /usr/sbin/snmptrapd
[ $? = 0 ] && echo "OK" || echo "FAIL"
fi
}
reload() {
if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then
printf "Reloading SNMP daemon: "
start-stop-daemon -q -K -s 1 -p /var/run/snmpd.pid -x /usr/sbin/snmpd
[ $? = 0 ] && echo "OK" || echo "FAIL"
fi
if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then
printf "Reloading SNMP trap daemon: "
start-stop-daemon -q -K -s 1 -p /var/run/snmptrapd.pid -x /usr/sbin/snmptrapd
[ $? = 0 ] && echo "OK" || echo "FAIL"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
# Allow the daemons time to exit completely.
sleep 2
start
;;
reload|force-reload)
reload
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,9 @@
# From https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.5.2/
sha1 051e2e919604f6fac96c1e7df7bd2ec0d288375f net-snmp-5.9.5.2.tar.gz
# Locally calculated after checking pgp signature at
# https://sourceforge.net/projects/net-snmp/files/net-snmp/5.9.5.2/net-snmp-5.9.5.2.tar.gz.asc/download
# using key 6E6718AEF1EB5C65C32D1B2A356BC0B552D53CAB
sha256 16707719f833184a4b72835dac359ae188123b06b5e42817c00790d7dc1384bf net-snmp-5.9.5.2.tar.gz
# Hash for license file
sha256 ed869ea395a1f125819a56676385ab0557a21507764bf56f2943302011381e59 COPYING

126
package/netsnmp/netsnmp.mk Normal file
View File

@@ -0,0 +1,126 @@
################################################################################
#
# netsnmp
#
################################################################################
NETSNMP_VERSION = 5.9.5.2
NETSNMP_SITE = https://downloads.sourceforge.net/project/net-snmp/net-snmp/$(NETSNMP_VERSION)
NETSNMP_SOURCE = net-snmp-$(NETSNMP_VERSION).tar.gz
NETSNMP_LICENSE = Various BSD-like
NETSNMP_LICENSE_FILES = COPYING
NETSNMP_CPE_ID_VENDOR = net-snmp
NETSNMP_CPE_ID_PRODUCT = $(NETSNMP_CPE_ID_VENDOR)
NETSNMP_SELINUX_MODULES = snmp
NETSNMP_INSTALL_STAGING = YES
# 0001-moving-Werror-declaration-after-statement-to-only-fo.patch
NETSNMP_AUTORECONF = YES
NETSNMP_CONF_ENV = \
ac_cv_NETSNMP_CAN_USE_SYSCTL=no \
ac_cv_path_PSPROG=/bin/ps
NETSNMP_CONF_OPTS = \
--with-persistent-directory=/var/lib/snmp \
--with-defaults \
--enable-mini-agent \
--without-rpm \
--with-logfile=none \
--without-kmem-usage \
--enable-as-needed \
--without-perl-modules \
--disable-embedded-perl \
--disable-perl-cc-checks \
--disable-scripts \
--with-default-snmp-version="1" \
--enable-silent-libtool \
--enable-mfd-rewrites \
--with-sys-contact="root@localhost" \
--with-sys-location="Unknown" \
--with-mib-modules="$(call qstrip,$(BR2_PACKAGE_NETSNMP_WITH_MIB_MODULES))" \
--with-out-mib-modules="$(call qstrip,$(BR2_PACKAGE_NETSNMP_WITHOUT_MIB_MODULES))" \
--disable-manuals
NETSNMP_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) LIB_LDCONFIG_CMD=true install
NETSNMP_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) LIB_LDCONFIG_CMD=true install
NETSNMP_CONFIG_SCRIPTS = net-snmp-config
define NETSNMP_USERS
snmp -1 snmp -1 * - - - snmpd user
endef
ifeq ($(BR2_INIT_SYSTEMD),y)
NETSNMP_CONF_OPTS += --with-systemd
else
NETSNMP_CONF_OPTS += --without-systemd
endif
ifeq ($(BR2_ENDIAN),"BIG")
NETSNMP_CONF_OPTS += --with-endianness=big
else
NETSNMP_CONF_OPTS += --with-endianness=little
endif
ifeq ($(BR2_PACKAGE_LIBNL),y)
NETSNMP_DEPENDENCIES += host-pkgconf libnl
NETSNMP_CONF_OPTS += --with-nl
else
NETSNMP_CONF_OPTS += --without-nl
endif
# OpenSSL
ifeq ($(BR2_PACKAGE_OPENSSL),y)
NETSNMP_DEPENDENCIES += host-pkgconf openssl
NETSNMP_CONF_OPTS += \
--with-openssl=$(STAGING_DIR)/usr/include/openssl \
--with-security-modules="tsm,usm" \
--with-transports="DTLSUDP,TLSTCP"
NETSNMP_CONF_ENV += LIBS=`$(PKG_CONFIG_HOST_BINARY) --libs openssl`
else ifeq ($(BR2_PACKAGE_NETSNMP_OPENSSL_INTERNAL),y)
NETSNMP_CONF_OPTS += --with-openssl=internal
else
NETSNMP_CONF_OPTS += --without-openssl
endif
# There's no option to forcibly enable or disable it
ifeq ($(BR2_PACKAGE_PCIUTILS),y)
NETSNMP_DEPENDENCIES += pciutils
endif
# For ucd-snmp/lmsensorsMib
ifeq ($(BR2_PACKAGE_LM_SENSORS),y)
NETSNMP_DEPENDENCIES += lm-sensors
endif
ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIBS),y)
NETSNMP_CONF_OPTS += --disable-mib-loading
NETSNMP_CONF_OPTS += --disable-mibs
endif
ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
NETSNMP_CONF_OPTS += --disable-debugging
endif
ifeq ($(BR2_PACKAGE_NETSNMP_SERVER),y)
NETSNMP_CONF_OPTS += --enable-agent
else
NETSNMP_CONF_OPTS += --disable-agent
endif
ifeq ($(BR2_PACKAGE_NETSNMP_CLIENTS),y)
NETSNMP_CONF_OPTS += --enable-applications
else
NETSNMP_CONF_OPTS += --disable-applications
endif
ifeq ($(BR2_PACKAGE_NETSNMP_SERVER),y)
define NETSNMP_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/netsnmp/S59snmpd \
$(TARGET_DIR)/etc/init.d/S59snmpd
endef
define NETSNMP_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 package/netsnmp/snmpd.service \
$(TARGET_DIR)/usr/lib/systemd/system/snmpd.service
endef
endif
$(eval $(autotools-package))

View File

@@ -0,0 +1,15 @@
[Unit]
Description=SNMP Daemon
After=network.target
ConditionPathExists=/etc/snmp/snmpd.conf
[Service]
Type=simple
Environment=MIBDIRS=/usr/share/snmp/mibs
Environment=SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid -u snmp -g snmp 127.0.0.1'
EnvironmentFile=-/etc/default/snmpd
PassEnvironment=MIBDIRS
ExecStart=/usr/sbin/snmpd -f $SNMPDOPTS
[Install]
WantedBy=multi-user.target