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

[snmp] Upgrading to snmpd v5.8 #3994

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 rules/docker-fpm-frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER_FPM_FRR_DBG = $(DOCKER_FPM_FRR_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/$(DOCKER_FPM_FRR_STEM)

$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG)
$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG) $(LIBSNMP_DEV)
$(DOCKER_FPM_FRR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
$(DOCKER_FPM_FRR)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) \
$(FRR_DBG) $(FRR_SNMP_DBG) $(LIBYANG_DBG)
Expand Down
4 changes: 4 additions & 0 deletions rules/lm-sensors.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ $(eval $(call add_derived_package,$(LM_SENSORS),$(LIBSENSORS)))
LIBSENSORS_DBG = libsensors4-dbgsym_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBSENSORS),$(LIBSENSORS_DBG)))

LIBSENSORS_DEV = libsensors4-dev_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBSENSORS),$(LIBSENSORS_DEV)))

SENSORD = sensord_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LM_SENSORS),$(SENSORD)))
$(SENSORD)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS)
Expand All @@ -41,3 +44,4 @@ export LM_SENSORS_VERSION_FULL
export LM_SENSORS_DBG
export LIBSENSORS_DBG
export SENSORD_DBG
export LIBSENSORS_DEV
29 changes: 18 additions & 11 deletions rules/snmpd.mk
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# snmpd package

SNMPD_VERSION = 5.7.3+dfsg
SNMPD_VERSION_FULL = $(SNMPD_VERSION)-1.5
SNMPD_VERSION = 5.8+dfsg
SNMPD_VERSION_FULL = $(SNMPD_VERSION)-2

export SNMPD_VERSION SNMPD_VERSION_FULL

LIBSNMP_BASE = libsnmp-base_$(SNMPD_VERSION_FULL)_all.deb
$(LIBSNMP_BASE)_SRC_PATH = $(SRC_PATH)/snmpd
$(LIBSNMP_BASE)_DEPENDS += $(LIBNL3_DEV)
$(LIBSNMP_BASE)_RDEPENDS += $(LIBNL3)
$(LIBSNMP_BASE)_DEPENDS += $(LIBNL3_DEV) $(LIBSENSORS_DEV)
$(LIBSNMP_BASE)_RDEPENDS += $(LIBNL3) $(LIBSENSORS)
SONIC_MAKE_DEBS += $(LIBSNMP_BASE)

SNMPTRAPD = snmptrapd_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
Expand All @@ -32,29 +32,25 @@ $(eval $(call add_derived_package,$(SNMP),$(SNMP_DBG)))
SNMPD_DBG = snmpd-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(SNMPD),$(SNMPD_DBG)))

LIBSNMP = libsnmp30_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
LIBSNMP = libsnmp35_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(LIBSNMP)_RDEPENDS += $(LIBSNMP_BASE)
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(LIBSNMP)))

LIBSNMP_DBG = libsnmp30-dbg_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
LIBSNMP_DBG = libsnmp35-dbg_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(LIBSNMP_DBG)_DEPENDS += $(LIBSNMP)
$(LIBSNMP_DBG)_RDEPENDS += $(LIBSNMP)
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(LIBSNMP_DBG)))

LIBSNMP_DEV = libsnmp-dev_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(LIBSNMP_DEV)_DEPENDS += $(LIBSNMP)
$(LIBSNMP_DEV)_RDEPENDS += $(LIBSENSORS_DEV)
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(LIBSNMP_DEV)))

LIBSNMP_PERL = libsnmp-perl_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(LIBSNMP_PERL)_DEPENDS += $(LIBSNMP)
$(LIBSNMP_PERL)_RDEPENDS += $(LIBSNMP)
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(LIBSNMP_PERL)))

PYTHON_NETSNMP = python-netsnmp_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PYTHON_NETSNMP)_DEPENDS += $(LIBSNMP)
$(PYTHON_NETSNMP)_RDEPENDS += $(LIBSNMP)
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(PYTHON_NETSNMP)))

TKMIB = tkmib_$(SNMPD_VERSION_FULL)_all.deb
$(TKMIB)_DEPENDS += $(LIBSNMP_PERL)
$(TKMIB)_RDEPENDS += $(LIBSNMP_PERL)
Expand All @@ -65,3 +61,14 @@ $(eval $(call add_derived_package,$(LIBSNMP_BASE),$(TKMIB)))
#
DBG_SRC_ARCHIVE += snmpd

export LIBSNMP_BASE
export SNMPTRAPD
export SNMP
export SNMPD
export SNMP_DBG
export SNMPD_DBG
export LIBSNMP
export LIBSNMP_DBG
export LIBSNMP_DEV
export LIBSNMP_PERL
export TKMIB
3 changes: 0 additions & 3 deletions sonic-slave-stretch/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ RUN apt-get update && apt-get install -y \
chrpath \
# For frr build
libc-ares-dev \
libsnmp-dev \
libjson-c3 \
libjson-c-dev \
libsystemd-dev \
Expand Down Expand Up @@ -219,8 +218,6 @@ RUN apt-get update && apt-get install -y \
libperl-dev \
libpci-dev \
libpci3 \
libsensors4 \
libsensors4-dev \
libwrap0-dev \
# For lldpd
debhelper \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 46f15b164e2e26b05b1a88b931bb40a01a4e6904 Mon Sep 17 00:00:00 2001
From: Tamer Ahmed <tamer.ahmed@microsoft.com>
Date: Fri, 10 Jan 2020 13:59:41 -0800
Subject: [libsensors-dev] Adding virtual package name

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
---
debian/control | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/lm-sensors/lm-sensors-3.4.0/debian/control b/src/lm-sensors/lm-sensors-3.4.0/debian/control
index 0000000..59e99a8
--- a/src/lm-sensors/lm-sensors-3.4.0/debian/control
+++ b/src/lm-sensors/lm-sensors-3.4.0/debian/control
@@ -38,6 +38,7 @@ Description: library to read temperature/voltage/fan sensors
This package contains a shared library for querying lm-sensors.

Package: libsensors4-dev
+Provides: libsensors-dev
Architecture: any
Depends: libsensors4 (= ${binary:Version}), ${misc:Depends}
Conflicts: lm-sensors (<< 1:3.1.1-6), libsensors-dev
--
2.17.1

14 changes: 8 additions & 6 deletions src/lm-sensors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ SHELL = /bin/bash


MAIN_TARGET = $(LM_SENSORS)
DERIVED_TARGETS = fancontrol_$(LM_SENSORS_VERSION_FULL)_all.deb \
libsensors4_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
sensord_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
$(LM_SENSORS_DBG) \
$(LIBSENSORS_DBG) \
$(SENSORD_DBG)
DERIVED_TARGETS = \
$(FANCONTROL) \
$(LIBSENSORS) \
$(SENSORD) \
$(LM_SENSORS_DBG) \
$(LIBSENSORS_DBG) \
$(SENSORD_DBG) \
$(LIBSENSORS_DEV)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf lm-sensors-$(LM_SENSORS_VERSION)
Expand Down
35 changes: 18 additions & 17 deletions src/snmpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@ SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e

MAIN_TARGET = libsnmp-base_$(SNMPD_VERSION_FULL)_all.deb
DERIVED_TARGETS = snmptrapd_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmp_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmpd_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmp-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
snmpd-dbgsym_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp30_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp30-dbg_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp-dev_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
libsnmp-perl_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
python-netsnmp_$(SNMPD_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
tkmib_$(SNMPD_VERSION_FULL)_all.deb
MAIN_TARGET = $(LIBSNMP_BASE)
DERIVED_TARGETS = \
$(SNMPTRAPD) \
$(SNMP) \
$(SNMPD) \
$(SNMP_DBG) \
$(SNMPD_DBG) \
$(LIBSNMP) \
$(LIBSNMP_DBG) \
$(LIBSNMP_DEV) \
$(LIBSNMP_PERL) \
$(TKMIB)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf net-snmp-$(SNMPD_VERSION)

# download debian net-snmp
wget -NO net-snmp_$(SNMPD_VERSION_FULL).dsc "https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.7.3+dfsg-1.5.dsc?sv=2015-04-05&sr=b&sig=vDAYAKlwi7JjF%2FesdJUyf4VIEXPsCfLhqqTqNr75zBs%3D&se=2030-10-12T13%3A59%3A45Z&sp=r"
wget -NO net-snmp_$(SNMPD_VERSION).orig.tar.xz "https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.7.3+dfsg.orig.tar.xz?sv=2015-04-05&sr=b&sig=UjIh%2FTcHrIEzEV7a%2BV2ZP4ks3xHlAA3wqyxkyV7Ms8I%3D&se=2030-10-12T13%3A58%3A19Z&sp=r"
wget -NO net-snmp_$(SNMPD_VERSION_FULL).debian.tar.xz "https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.7.3+dfsg-1.5.debian.tar.xz?sv=2015-04-05&sr=b&sig=xJkmxjtKXYcPe4yR%2FuCA0TXUfT40rj4XUMBaiK9CjsA%3D&se=2030-10-12T14%3A00%3A15Z&sp=r"
# download debian net-snmp from Azure cache. Debian packages are obtained from:
# https://packages.debian.org/sid/libsnmp-dev
wget -NO net-snmp_$(SNMPD_VERSION_FULL).dsc "https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.8+dfsg-2.dsc?sv=2015-04-05&sr=b&sig=BXvY%2BFaOQ7utLcU%2FubM%2F1Fm%2FAxinYHjjw6iE9MzwJD4%3D&se=2033-09-16T21%3A48%3A19Z&sp=r"
Copy link
Collaborator

@qiluo-msft qiluo-msft Jan 9, 2020

Choose a reason for hiding this comment

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

https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.8+dfsg-2.dsc?sv=2015-04-05&sr=b&sig=BXvY%2BFaOQ7utLcU%2FubM%2F1Fm%2FAxinYHjjw6iE9MzwJD4%3D&se=2033-09-16T21%3A48%3A19Z&sp=r [](start = 46, length = 186)

Could you have some comment in code, to show the original download URL?
like dget http://XXXXX.dsc
So in future, dev will know where to find new version. #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

wget -NO net-snmp_$(SNMPD_VERSION).orig.tar.xz "https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.8+dfsg.orig.tar.xz?sv=2015-04-05&sr=b&sig=WE5XDcTJeMib0SZC0%2Fc%2BlUDKM1ZSkJUhvXISbYz%2F4GY%3D&se=2033-09-16T21%3A48%3A49Z&sp=r"
wget -NO net-snmp_$(SNMPD_VERSION_FULL).debian.tar.xz "https://sonicstorage.blob.core.windows.net/packages/net-snmp_5.8+dfsg-2.debian.tar.xz?sv=2015-04-05&sr=b&sig=25RA8gIphn0EyeUpZRwSTAm4z69NJrIFJyY6KkC9PMs%3D&se=2033-09-16T21%3A47%3A28Z&sp=r"
dpkg-source -x net-snmp_$(SNMPD_VERSION_FULL).dsc

pushd net-snmp-$(SNMPD_VERSION)
git init
git add -f *
git add -f .
Copy link
Collaborator

@qiluo-msft qiluo-msft Jan 9, 2020

Choose a reason for hiding this comment

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

git add -f . [](start = 1, length = 12)

What is diff? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add * does not add hidden files.

git commit -m "unmodified snmpd source"

# Apply patches
Expand Down

This file was deleted.

This file was deleted.

Loading