[dockers]: Upgrade LLDP docker to stretch build (#2633)

* [dockers]: Upgrade LLDP docker to stretch build
This commit is contained in:
Sangita Maity 2019-04-17 10:59:58 -07:00 committed by lguohan
parent b0b0862d54
commit 047c7c8915
5 changed files with 34 additions and 13 deletions

View File

@ -1,4 +1,4 @@
FROM docker-config-engine FROM docker-config-engine-stretch
ARG docker_container_name ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
@ -9,8 +9,6 @@ ENV DEBIAN_FRONTEND=noninteractive
# Update apt's cache of available packages # Update apt's cache of available packages
RUN apt-get update RUN apt-get update
# Install dependencies
RUN apt-get install -y python-pip libbsd0 libevent-2.0-5 libjansson4 libwrap0 libxml2 libpci3 libperl5.20 libpython2.7
{% if docker_lldp_sv2_debs.strip() -%} {% if docker_lldp_sv2_debs.strip() -%}
# Copy locally-built Debian package dependencies # Copy locally-built Debian package dependencies

View File

@ -4,9 +4,10 @@ DOCKER_LLDP_SV2 = docker-lldp-sv2.gz
$(DOCKER_LLDP_SV2)_PATH = $(DOCKERS_PATH)/docker-lldp-sv2 $(DOCKER_LLDP_SV2)_PATH = $(DOCKERS_PATH)/docker-lldp-sv2
$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON)
$(DOCKER_LLDP_SV2)_PYTHON_WHEELS += $(DBSYNCD_PY2) $(DOCKER_LLDP_SV2)_PYTHON_WHEELS += $(DBSYNCD_PY2)
$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) $(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
SONIC_DOCKER_IMAGES += $(DOCKER_LLDP_SV2) SONIC_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
SONIC_STRETCH_DOCKERS += $(DOCKER_LLDP_SV2)
$(DOCKER_LLDP_SV2)_CONTAINER_NAME = lldp $(DOCKER_LLDP_SV2)_CONTAINER_NAME = lldp
$(DOCKER_LLDP_SV2)_RUN_OPT += --net=host --privileged -t $(DOCKER_LLDP_SV2)_RUN_OPT += --net=host --privileged -t

View File

@ -1,17 +1,20 @@
# lldpd package # lldpd package
LLDPD_VERSION = 0.9.6 LLDPD_VERSION = 0.9.6
LLDPD_VERSION_SUFFIX = 1
LLDPD_VERSION_FULL = $(LLDPD_VERSION)-$(LLDPD_VERSION_SUFFIX)
LLDPD = lldpd_$(LLDPD_VERSION)-0_amd64.deb LLDPD = lldpd_$(LLDPD_VERSION_FULL)_amd64.deb
$(LLDPD)_DEPENDS += $(LIBSNMP_DEV) $(LLDPD)_DEPENDS += $(LIBSNMP_DEV)
$(LLDPD)_RDEPENDS += $(LIBSNMP) $(LLDPD)_RDEPENDS += $(LIBSNMP)
$(LLDPD)_SRC_PATH = $(SRC_PATH)/lldpd $(LLDPD)_SRC_PATH = $(SRC_PATH)/lldpd
SONIC_MAKE_DEBS += $(LLDPD) SONIC_MAKE_DEBS += $(LLDPD)
LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION)-0_amd64.deb LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION_FULL)_amd64.deb
$(eval $(call add_derived_package,$(LLDPD),$(LIBLLDPCTL))) $(eval $(call add_derived_package,$(LLDPD),$(LIBLLDPCTL)))
# Export these variables so they can be used in a sub-make # Export these variables so they can be used in a sub-make
export LLDPD_VERSION export LLDPD_VERSION
export LLDPD_VERSION_FULL
export LLDPD export LLDPD
export LIBLLDPCTL export LIBLLDPCTL

View File

@ -184,6 +184,12 @@ RUN apt-get update && apt-get install -y \
libsensors4 \ libsensors4 \
libsensors4-dev \ libsensors4-dev \
libwrap0-dev \ libwrap0-dev \
# For lldpd
debhelper \
autotools-dev \
libbsd-dev \
pkg-config \
check \
# For mpdecimal # For mpdecimal
docutils-common \ docutils-common \
libjs-sphinxdoc \ libjs-sphinxdoc \
@ -261,6 +267,7 @@ RUN pip install click-default-group click natsort tabulate netifaces==0.10.7 fas
# For sonic snmpagent mock testing # For sonic snmpagent mock testing
RUN pip3 install mockredispy==2.9.3 RUN pip3 install mockredispy==2.9.3
RUN pip3 install PyYAML>=5.1 RUN pip3 install PyYAML>=5.1
# For sonic-platform-common testing # For sonic-platform-common testing

View File

@ -5,18 +5,30 @@ SHELL = /bin/bash
MAIN_TARGET = $(LLDPD) MAIN_TARGET = $(LLDPD)
DERIVED_TARGETS = $(LIBLLDPCTL) DERIVED_TARGETS = $(LIBLLDPCTL)
LLDP_URL = http://ftp.debian.org/debian/pool/main/l/lldpd
DSC_FILE = lldpd_$(LLDPD_VERSION_FULL).dsc
ORIG_FILE = lldpd_$(LLDPD_VERSION).orig.tar.gz
DEBIAN_FILE = lldpd_$(LLDPD_VERSION_FULL).debian.tar.xz
DSC_FILE_URL = $(LLDP_URL)/$(DSC_FILE)
ORIG_FILE_URL = $(LLDP_URL)/$(ORIG_FILE)
DEBIAN_FILE_URL = $(LLDP_URL)/$(DEBIAN_FILE)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files # Remove any stale files
rm -rf ./lldpd rm -rf ./lldpd
# Clone lldpd repo # download debian LLDPDD
git clone https://github.com/vincentbernat/lldpd.git wget -NO "$(DSC_FILE)" $(DSC_FILE_URL)
pushd ./lldpd wget -NO "$(ORIG_FILE)" $(ORIG_FILE_URL)
wget -NO "$(DEBIAN_FILE)" $(DEBIAN_FILE_URL)
dpkg-source -x lldpd_$(LLDPD_VERSION_FULL).dsc
# Reset HEAD to the commit of the proper tag pushd lldpd-$(LLDPD_VERSION)
# NOTE: Using "git checkout <tag_name>" here detaches our HEAD, git init
# which stg doesn't like, so we use this method instead git add -f *
git reset --hard $(LLDPD_VERSION) git commit -m "unmodified lldp source"
# Apply patches # Apply patches
stg init stg init