Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bookworm container upgrade for lldp, net-snmp #18150

Merged
merged 23 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c028a96
bookworm container upgrade for lldp
mohan-selvaraj Feb 21, 2024
cdc6491
Fix for build hooks debian permission error
Kalimuthu-Velappan Oct 20, 2022
486e018
Changes for building community master in broadcom LSF servers-Jan'24
Kalimuthu-Velappan Sep 30, 2021
bd3032a
Changes for building community master in broadcom LSF servers
Kalimuthu-Velappan Sep 30, 2021
8ac21a4
bookworm container upgrade for net-snmp
mohan-selvaraj Feb 27, 2024
1c93393
bookworm container upgrade for net-snmp
mohan-selvaraj Feb 27, 2024
cb6b78a
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Feb 27, 2024
0dcf92a
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Feb 27, 2024
4c22c94
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Feb 27, 2024
eee618a
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Feb 27, 2024
c0f193c
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Feb 29, 2024
1c7ef70
bookworm container upgrade for lldp, net-snmp
mohan-selvaraj Mar 13, 2024
5b3195e
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Mar 13, 2024
a6a135f
bookworm container upgrade for lldp, net-snmp
mohan-selvaraj Mar 13, 2024
786843d
bookworm container upgrade for lldp, net-snmp
mohan-selvaraj Mar 13, 2024
16ff1a9
bookworm container upgrade for lldp, net-snmp
mohan-selvaraj Mar 15, 2024
82a79ae
Merge branch 'sonic-net:master' into lldp_bkwm
mohan-selvaraj Mar 19, 2024
a167f06
update supervisord.conf file to use correct stdout and stderr flags
mohan-selvaraj Mar 28, 2024
35b3a91
Merge branch 'sonic-net:master' into lldp_bkwm
mohan-selvaraj Apr 11, 2024
3ee040f
Merge branch 'sonic-net:master' into lldp_bkwm
mohan-selvaraj Apr 12, 2024
1e4942e
Add patch 0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.p…
mohan-selvaraj Apr 16, 2024
e137b62
Merge branch 'master' into lldp_bkwm
mohan-selvaraj Apr 16, 2024
f2d05dd
Merge branch 'lldp_bkwm' of github.com:mohan-selvaraj/sonic-buildimag…
mohan-selvaraj Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dockers/docker-lldp/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
ARG image_version
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-snmp/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python3_wheels, copy_files %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
ARG image_version
Expand Down
16 changes: 8 additions & 8 deletions dockers/docker-snmp/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ command=/usr/sbin/rsyslogd -n -iNONE
priority=1
autostart=false
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog
stdout_syslog=true
stderr_syslog=true
dependent_startup=true

[program:start]
Expand All @@ -34,8 +34,8 @@ priority=1
autostart=true
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
stdout_syslog=true
stderr_syslog=true
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running

Expand All @@ -44,8 +44,8 @@ command=/usr/sbin/snmpd -f -LS0-2d -u Debian-snmp -g Debian-snmp -I -smux,mteTri
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
stdout_syslog=true
stderr_syslog=true
dependent_startup=true
dependent_startup_wait_for=start:exited

Expand All @@ -54,7 +54,7 @@ command=/usr/bin/env python3 -m sonic_ax_impl
priority=4
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
stdout_syslog=true
stderr_syslog=true
dependent_startup=true
dependent_startup_wait_for=snmpd:running
10 changes: 5 additions & 5 deletions rules/docker-lldp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ $(DOCKER_LLDP)_PATH = $(DOCKERS_PATH)/docker-lldp

$(DOCKER_LLDP)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON)

$(DOCKER_LLDP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_LLDP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_LLDP)_DBG_DEPENDS += $(LLDPD_DBG) $(LIBSWSSCOMMON_DBG)

$(DOCKER_LLDP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)
$(DOCKER_LLDP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)

$(DOCKER_LLDP)_PYTHON_WHEELS += $(DBSYNCD_PY3)
$(DOCKER_LLDP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_LLDP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)

$(DOCKER_LLDP)_VERSION = 1.0.0
$(DOCKER_LLDP)_PACKAGE_NAME = lldp
Expand All @@ -36,5 +36,5 @@ $(DOCKER_LLDP)_BASE_IMAGE_FILES += lldpctl:/usr/bin/lldpctl
$(DOCKER_LLDP)_BASE_IMAGE_FILES += lldpcli:/usr/bin/lldpcli
$(DOCKER_LLDP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)

SONIC_BULLSEYE_DOCKERS += $(DOCKER_LLDP)
SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_LLDP_DBG)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_LLDP)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_LLDP_DBG)
10 changes: 5 additions & 5 deletions rules/docker-snmp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ $(DOCKER_SNMP)_PATH = $(DOCKERS_PATH)/docker-snmp
## TODO: remove LIBPY3_DEV if we can get pip3 directly
$(DOCKER_SNMP)_DEPENDS += $(SNMP) $(SNMPD)

$(DOCKER_SNMP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_SNMP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_SNMP)_DBG_DEPENDS += $(SNMP_DBG) $(SNMPD_DBG) $(LIBSNMP_DBG)
$(DOCKER_SNMP)_DBG_DEPENDS += $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON)

$(DOCKER_SNMP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)
$(DOCKER_SNMP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)

$(DOCKER_SNMP)_PYTHON_WHEELS += $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3) $(ASYNCSNMP_PY3)
$(DOCKER_SNMP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)
$(DOCKER_SNMP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)

$(DOCKER_SNMP)_VERSION = 1.0.0
$(DOCKER_SNMP)_PACKAGE_NAME = snmp
Expand All @@ -34,5 +34,5 @@ $(DOCKER_SNMP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro
$(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d

SONIC_BULLSEYE_DOCKERS += $(DOCKER_SNMP)
SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_SNMP_DBG)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SNMP)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_SNMP_DBG)
13 changes: 10 additions & 3 deletions rules/snmpd.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# snmpd package

ifeq ($(BLDENV),bullseye)
ifeq ($(BLDENV),bookworm)
SNMPD_VERSION = 5.9.3+dfsg
SNMPD_VERSION_FULL = $(SNMPD_VERSION)-2
else ifeq ($(BLDENV),bullseye)
SNMPD_VERSION = 5.9+dfsg
SNMPD_VERSION_FULL = $(SNMPD_VERSION)-4+deb11u1
else
Expand Down Expand Up @@ -37,15 +40,19 @@ $(eval $(call add_derived_package,$(LIBSNMP_BASE),$(SNMP_DBG)))
SNMPD_DBG = snmpd-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(SNMPD_DBG)))

ifeq ($(BLDENV),bullseye)
ifeq ($(BLDENV),bookworm)
LIBSNMP = libsnmp40_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
else ifeq ($(BLDENV),bullseye)
LIBSNMP = libsnmp40_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
else
LIBSNMP = libsnmp30_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
endif
$(LIBSNMP)_RDEPENDS += $(LIBSNMP_BASE)
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(LIBSNMP)))

ifeq ($(BLDENV),bullseye)
ifeq ($(BLDENV),bookworm)
LIBSNMP_DBG = libsnmp40-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
else ifeq ($(BLDENV),bullseye)
LIBSNMP_DBG = libsnmp40-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
else
LIBSNMP_DBG = libsnmp30-dbg_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 8bb8849524aba2124be3279a5197ad5fbfe166b2 Mon Sep 17 00:00:00 2001
From: pavel-shirshov <pavelsh@microsoft.com>
Date: Mon, 27 Aug 2018 16:50:16 +0800
Subject: [PATCH] [SNMP] Stop spamming logs with statfs permission denied log

---
agent/mibgroup/hardware/fsys/fsys_mntctl.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/agent/mibgroup/hardware/fsys/fsys_mntctl.c b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
index 782c8ed..7819fe4 100644
--- a/agent/mibgroup/hardware/fsys/fsys_mntctl.c
+++ b/agent/mibgroup/hardware/fsys/fsys_mntctl.c
@@ -167,8 +167,6 @@ netsnmp_fsys_arch_load( void )
continue;

if ( statfs( entry->path, &stat_buf ) < 0 ) {
- snprintf( tmpbuf, sizeof(tmpbuf), "Cannot statfs %s", entry->path );
- snmp_log_perror( tmpbuf );
continue;
}
entry->units = stat_buf.f_bsize;
--
2.18.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From bd7d6d79217da6b5a2eb3a3ee1d409c175a61e41 Mon Sep 17 00:00:00 2001
From: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Fri, 20 Sep 2019 00:42:19 +0000
Subject: [PATCH] Enable macro DEB_BUILD_ARCH_OS in order to build ipv6 feature

---
debian/rules | 2 ++
1 file changed, 2 insertions(+)

diff --git a/debian/rules b/debian/rules
index 34d8509..496be59 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,8 @@
export DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildtools.mk
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)

LIB_VERSION = 40

--
2.18.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0d3e33ff197d1d15c0036b69cca5198e54781efe Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bvanassche@acm.org>
Date: Sun, 24 Jul 2022 16:45:05 -0700
Subject: [PATCH] agent/Makefile.in: Unbreak the --enable-minimalist build

Build the features rules in the mibgroup directory before building the
features rules in the helpers directory.

Fixes: 51128ad09507 ("agent/Makefile.in: Build the MIB module code once")
Fixes: https://github.com/net-snmp/net-snmp/issues/438
---
agent/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/agent/Makefile.in b/agent/Makefile.in
index 047d880..44f8818 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -16,7 +16,7 @@ mysubdir=agent
# what to install
#
SUBDIRS=helpers
-FTSUBDIRS=helpers
+FTSUBDIRS=mibgroup helpers

INSTALLSBINPROGS= @SNMPD@
INSTALLLIBS = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
--
2.18.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/debian/rules b/debian/rules
index 496be59..939e1a4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,10 +37,6 @@ endif
%:
dh $@

-# The net-snmp Makefiles cannot handle parallel builds
-override_dh_auto_build:
- dh_auto_build --no-parallel
-
override_dh_auto_configure:
dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
--with-persistent-directory=/var/lib/snmp \
--
2.18.0

20 changes: 20 additions & 0 deletions src/snmpd/patch-5.9.3+dfsg/cross-compile-changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/debian/rules b/debian/rules
index 939e1a4..efd323e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,12 @@ include /usr/share/dpkg/buildtools.mk
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)

+DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
+
+ifneq ($(DEB_BUILD_MULTIARCH),$(DEB_HOST_MULTIARCH))
+export PERL5OPT := -I/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config
+endif
+
LIB_VERSION = 40

MIB_MODULES = smux ucd-snmp/dlmod mibII/mta_sendmail disman/event-mib
--
2.18.0

5 changes: 5 additions & 0 deletions src/snmpd/patch-5.9.3+dfsg/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch
0008-Enable-macro-DEB_BUILD_ARCH_OS-in-order-to-build-ipv.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch, 0009-Makefile.in-agent-Makefile.in-Fix-parallel-compilati.patch, 0010-Makefile.in-Make-sure-that-sedscript-is-built-before.patch, 0011-agent-Makefile.in-Build-the-MIB-module-code-once.patch, and 0012-agent-Makefile.in-Unbreak-the-enable-minimalist-buil.patch were dropped. But it doesn't seem like the changes in those patches are in 5.9.3. Is there a reason these patches were dropped?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if the code in the dropped patches aren't present in the 5.9.3 codebase.
I had an earlier comment on which patches were required and which can be ignored.

Copy link
Contributor

@saiarcot895 saiarcot895 Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch is needed, 0008-Enable-macro-DEB_BUILD_ARCH_OS-in-order-to-build-ipv.patch can be optionally dropped (since that logic is now coming from include /usr/share/dpkg/architecture.mk in debian/rules), 0012-agent-Makefile.in-Unbreak-the-enable-minimalist-buil.patch is needed. The others are correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saiarcot895
As I understand, the only reason why we build snmp packages (libsnmp-base, snmptrapd, snmp, snmpd, libsnmp40, libsnmp-dev, libsnmp-perl, tkmib) from source is 0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch. Maybe it's possible to find another solution without modifyng source code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Based on what's in sonic-net/sonic-snmpagent#22, there might not be any changes needed at all. For now, I prefer to let this get merged in, and then look at removing the snmp build (either in time for 202405 release or after the branch cutoff).

Copy link
Contributor

@k-v1 k-v1 Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saiarcot895

We should remove 0001-SNMP-Stop-spamming-logs-with-statfs-permission-denie.patch
fsys_mntctl.c is for AIX: https://github.com/net-snmp/net-snmp/blob/59acd6e6fcfccfd3456ec8a65816ca76036e142f/agent/mibgroup/hardware/fsys.h#L2
Original bug in fsys_mntent.c has been already fixed in upstream: bvanassche/net-snmp@5f1986c

0012-agent-Makefile.in-Unbreak-the-enable-minimalist-buil.patch
0013-enable-parallel-build-for-net-snmp.patch
cross-compile-changes.patch
Loading