[build]: Added debug symbols to many debug dockers. (#3098)
* Added debug symbols to many debug dockers. * For debug images *only*: 1) Archive source files into debug image 2) Archived source is copied into /src 3) Created an empty dir /debug 4) Mount both /src as ro & /debug as rw into every docker 5) Login banner will give some details on /src & /debug 6) Devs can copy core file into /debug and view it from inside a container. 7) Dev may create all gdb logs and other data directly into /debug. * Dropped redundant REDIS_TOOLS per review comments. * Added debug symbols to frr package and hence FRR based BGP docker. * 1) Moved dbg_files.sh to scripts/ 2) Src directories to archive are now collected from individual Makefiles. 3) Added few more debug symbols 4) Added few more debug dockers. Here after no more changes except per review comments. To debug: Install required version of debug image in Switch or VM. Copy core file into /debug of host Get into Docker gdb /usr/bin/<daemon> -c /debug/<your core file> set directory /src/... <-- inside gdb to get the source For non-in-depth debugging: Download corresponding debug Docker image (docker-...-dbg.gz) to your VM Load the image Run image with entrypoint as 'bash' with dir containing core mapped in. Run gdb on the core.
This commit is contained in:
parent
f14354f003
commit
76bf5a0bc4
@ -422,6 +422,28 @@ fi
|
||||
sudo sed -i 's/EBTABLES_LOAD_ON_START="no"/EBTABLES_LOAD_ON_START="yes"/g' ${FILESYSTEM_ROOT}/etc/default/ebtables
|
||||
sudo cp files/image_config/ebtables/ebtables.filter ${FILESYSTEM_ROOT}/etc
|
||||
|
||||
## Debug Image specific changes
|
||||
## Update motd for debug image
|
||||
if [ "$DEBUG_IMG" == "y" ]
|
||||
then
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '**************' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo 'Running DEBUG image' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '**************' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '/src has the sources' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '/src is mounted in each docker' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '/debug is created for core files or temp files' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo 'Create a subdir under /debug to upload your files' >> /etc/motd"
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '/debug is mounted in each docker' >> /etc/motd"
|
||||
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/src
|
||||
pushd src
|
||||
../scripts/dbg_files.sh | sudo tar -cvzf ../$FILESYSTEM_ROOT/src/sonic_src.tar.gz -T -
|
||||
popd
|
||||
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/debug
|
||||
|
||||
fi
|
||||
|
||||
## Remove gcc and python dev pkgs
|
||||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y remove gcc libpython2.7-dev
|
||||
|
||||
|
@ -53,13 +53,6 @@ RUN apt-get -y purge \
|
||||
{{ install_debian_packages(docker_base_stretch_debs.split(' ')) }}
|
||||
{%- endif %}
|
||||
|
||||
{% if docker_base_stretch_dbgs.strip() -%}
|
||||
# Install common debug-packages
|
||||
RUN apt-get -y install docker_base_stretch_dbgs.split(' ') | join(' ')
|
||||
{% else %}
|
||||
RUN ln /usr/bin/vim.tiny /usr/bin/vim
|
||||
{%- endif %}
|
||||
|
||||
# Clean up apt
|
||||
# Remove /var/lib/apt/lists/*, could be obsoleted for derived images
|
||||
RUN apt-get clean -y && \
|
||||
|
@ -170,6 +170,9 @@ start() {
|
||||
# TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version
|
||||
{%- endif %}
|
||||
docker create {{docker_image_run_opt}} \
|
||||
{%- if install_debug_image == "y" %}
|
||||
-v /src:/src:ro -v /debug:/debug:rw \
|
||||
{%- endif %}
|
||||
{%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %}
|
||||
--log-opt max-size=2M --log-opt max-file=5 \
|
||||
{%- endif %}
|
||||
|
@ -12,9 +12,6 @@ OPENSSH = openssh-client
|
||||
SSHPASS = sshpass
|
||||
STRACE = strace
|
||||
$(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES += $(GDB) $(GDBSERVER) $(VIM) $(OPENSSH) $(SSHPASS) $(STRACE)
|
||||
ifeq ($(INSTALL_DEBUG_TOOLS),y)
|
||||
$(DOCKER_BASE_STRETCH)_DBG_PACKAGES += $($(DOCKER_BASE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
endif
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_BASE_STRETCH)
|
||||
SONIC_STRETCH_DOCKERS += $(DOCKER_BASE_STRETCH)
|
||||
|
@ -8,6 +8,7 @@ $(DOCKER_DATABASE)_PATH = $(DOCKERS_PATH)/$(DOCKER_DATABASE_STEM)
|
||||
|
||||
$(DOCKER_DATABASE)_DEPENDS += $(REDIS_TOOLS) $(REDIS_SERVER)
|
||||
$(DOCKER_DATABASE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_DATABASE)_DBG_DEPENDS += $(REDIS_SERVER_DBG)
|
||||
|
||||
$(DOCKER_DATABASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
|
@ -8,6 +8,8 @@ $(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_RELAY_STEM)
|
||||
|
||||
$(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(REDIS_TOOLS)
|
||||
$(DOCKER_DHCP_RELAY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG)
|
||||
|
||||
$(DOCKER_DHCP_RELAY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
@ -1,10 +1,25 @@
|
||||
# docker image for fpm-frr
|
||||
|
||||
DOCKER_FPM_FRR = docker-fpm-frr.gz
|
||||
$(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/docker-fpm-frr
|
||||
DOCKER_FPM_FRR_STEM = docker-fpm-frr
|
||||
DOCKER_FPM_FRR = $(DOCKER_FPM_FRR_STEM).gz
|
||||
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)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_FPM_FRR)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) \
|
||||
$(FRR_DBG) $(FRR_SNMP_DBG) $(LIBYANG_DBG)
|
||||
|
||||
$(DOCKER_FPM_FRR)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR)
|
||||
SONIC_STRETCH_DOCKERS += $(DOCKER_FPM_FRR)
|
||||
|
||||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_FPM_FRR_DBG)
|
||||
SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_FPM_FRR_DBG)
|
||||
|
||||
$(DOCKER_FPM_FRR)_CONTAINER_NAME = bgp
|
||||
$(DOCKER_FPM_FRR)_RUN_OPT += --net=host --privileged -t
|
||||
@ -13,4 +28,3 @@ $(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/sonic/frr:/etc/frr:rw
|
||||
|
||||
$(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += vtysh:/usr/bin/vtysh
|
||||
|
||||
SONIC_STRETCH_DOCKERS += $(DOCKER_FPM_FRR)
|
||||
|
@ -4,6 +4,7 @@ ifeq ($(SONIC_ROUTING_STACK), quagga)
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_FPM_QUAGGA)
|
||||
else ifeq ($(SONIC_ROUTING_STACK), frr)
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_FPM_FRR)
|
||||
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_FPM_FRR_DBG)
|
||||
else
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_FPM_GOBGP)
|
||||
endif
|
||||
|
@ -1,14 +1,29 @@
|
||||
# docker image for lldp agent
|
||||
|
||||
DOCKER_LLDP_SV2 = docker-lldp-sv2.gz
|
||||
DOCKER_LLDP_SV2_STEM = docker-lldp-sv2
|
||||
DOCKER_LLDP_SV2 = $(DOCKER_LLDP_SV2_STEM).gz
|
||||
DOCKER_LLDP_SV2_DBG = $(DOCKER_LLDP_SV2_STEM)-$(DBG_IMAGE_MARK).gz
|
||||
|
||||
$(DOCKER_LLDP_SV2)_PATH = $(DOCKERS_PATH)/docker-lldp-sv2
|
||||
|
||||
$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON)
|
||||
|
||||
$(DOCKER_LLDP_SV2)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_LLDP_SV2)_DBG_DEPENDS += $(LLDPD_DBG) $(LIBSWSSCOMMON_DBG)
|
||||
|
||||
$(DOCKER_LLDP_SV2)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_LLDP_SV2)_PYTHON_WHEELS += $(DBSYNCD_PY2)
|
||||
$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
|
||||
SONIC_STRETCH_DOCKERS += $(DOCKER_LLDP_SV2)
|
||||
|
||||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_LLDP_SV2_DBG)
|
||||
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_LLDP_SV2_DBG)
|
||||
SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_LLDP_SV2_DBG)
|
||||
|
||||
$(DOCKER_LLDP_SV2)_CONTAINER_NAME = lldp
|
||||
$(DOCKER_LLDP_SV2)_RUN_OPT += --net=host --privileged -t
|
||||
$(DOCKER_LLDP_SV2)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||
|
@ -14,7 +14,9 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2)
|
||||
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2)
|
||||
|
||||
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG)
|
||||
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(LIBSENSORS_DBG)
|
||||
$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LM_SENSORS_DBG) $(SENSORD_DBG)
|
||||
|
||||
$(DOCKER_PLATFORM_MONITOR)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
@ -8,6 +8,8 @@ $(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/$(DOCKER_ROUTER_ADVERTISER_ST
|
||||
|
||||
$(DOCKER_ROUTER_ADVERTISER)_DEPENDS += $(RADVD) $(REDIS_TOOLS)
|
||||
$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS += $(RADVD_DBG)
|
||||
|
||||
$(DOCKER_ROUTER_ADVERTISER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
@ -1,15 +1,30 @@
|
||||
# docker image for snmp agent
|
||||
|
||||
DOCKER_SNMP_SV2 = docker-snmp-sv2.gz
|
||||
DOCKER_SNMP_SV2_STEM = docker-snmp-sv2
|
||||
DOCKER_SNMP_SV2 = $(DOCKER_SNMP_SV2_STEM).gz
|
||||
DOCKER_SNMP_SV2_DBG = $(DOCKER_SNMP_SV2_STEM)-$(DBG_IMAGE_MARK).gz
|
||||
|
||||
$(DOCKER_SNMP_SV2)_PATH = $(DOCKERS_PATH)/docker-snmp-sv2
|
||||
|
||||
## TODO: remove LIBPY3_DEV if we can get pip3 directly
|
||||
$(DOCKER_SNMP_SV2)_DEPENDS += $(SNMP) $(SNMPD) $(PY3) $(LIBPY3_DEV)
|
||||
|
||||
$(DOCKER_SNMP_SV2)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_SNMP_SV2)_DBG_DEPENDS += $(SNMP_DBG) $(SNMPD_DBG) $(LIBSNMP_DBG)
|
||||
|
||||
$(DOCKER_SNMP_SV2)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_SNMP_SV2)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3) $(SWSSSDK_PY3) $(ASYNCSNMP_PY3)
|
||||
$(DOCKER_SNMP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_SNMP_SV2)
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SNMP_SV2)
|
||||
SONIC_STRETCH_DOCKERS += $(DOCKER_SNMP_SV2)
|
||||
|
||||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_SV2_DBG)
|
||||
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_SV2_DBG)
|
||||
SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SNMP_SV2_DBG)
|
||||
|
||||
$(DOCKER_SNMP_SV2)_CONTAINER_NAME = snmp
|
||||
$(DOCKER_SNMP_SV2)_RUN_OPT += --net=host --privileged -t
|
||||
$(DOCKER_SNMP_SV2)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||
|
@ -9,6 +9,8 @@ $(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/$(DOCKER_TEAMD_STEM)
|
||||
$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(REDIS_TOOLS)
|
||||
$(DOCKER_TEAMD)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
$(DOCKER_TEAMD)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG)
|
||||
$(DOCKER_TEAMD)_DBG_DEPENDS += $(LIBTEAMDCT_DBG) $(LIBTEAM_UTILS_DBG)
|
||||
|
||||
$(DOCKER_TEAMD)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
$(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
|
@ -25,3 +25,8 @@ FRR_SNMP_DBG = frr-snmp-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(FRR),$(FRR_SNMP_DBG)))
|
||||
|
||||
export FRR FRR_PYTHONTOOLS FRR_DBG FRR_SNMP FRR_SNMP_DBG
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += sonic-frr
|
||||
|
@ -9,3 +9,6 @@ $(ISC_DHCP_RELAY)_SRC_PATH = $(SRC_PATH)/isc-dhcp
|
||||
SONIC_MAKE_DEBS += $(ISC_DHCP_RELAY)
|
||||
|
||||
SONIC_STRETCH_DEBS += $(ISC_DHCP_RELAY)
|
||||
|
||||
ISC_DHCP_RELAY_DBG = isc-dhcp-relay-dbgsym_$(ISC_DHCP_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(ISC_DHCP_RELAY),$(ISC_DHCP_RELAY_DBG)))
|
||||
|
@ -46,3 +46,8 @@ $(eval $(call add_derived_package,$(LIBNL3),$(LIBNL_CLI)))
|
||||
LIBNL_CLI_DEV = libnl-cli-3-dev_$(LIBNL3_VERSION)_amd64.deb
|
||||
$(LIBNL_CLI_DEV)_DEPENDS += $(LIBNL_CLI) $(LIBNL_GENL3_DEV) $(LIBNL_NF3_DEV) $(LIBNL_ROUTE3_DEV)
|
||||
$(eval $(call add_derived_package,$(LIBNL3),$(LIBNL_CLI_DEV)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += libnl3
|
||||
|
@ -9,6 +9,9 @@ $(LIBTEAM)_SRC_PATH = $(SRC_PATH)/libteam
|
||||
$(LIBTEAM)_DEPENDS += $(LIBNL_GENL3_DEV) $(LIBNL_CLI_DEV)
|
||||
SONIC_MAKE_DEBS += $(LIBTEAM)
|
||||
|
||||
LIBTEAM_DBG = libteam5-dbgsym_$(LIBTEAM_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBTEAM),$(LIBTEAM_DBG)))
|
||||
|
||||
LIBTEAM_DEV = libteam-dev_$(LIBTEAM_VERSION)_amd64.deb
|
||||
$(LIBTEAM_DEV)_DEPENDS += $(LIBTEAMDCT)
|
||||
$(eval $(call add_derived_package,$(LIBTEAM),$(LIBTEAM_DEV)))
|
||||
@ -16,6 +19,17 @@ $(eval $(call add_derived_package,$(LIBTEAM),$(LIBTEAM_DEV)))
|
||||
LIBTEAMDCT = libteamdctl0_$(LIBTEAM_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBTEAM),$(LIBTEAMDCT)))
|
||||
|
||||
LIBTEAMDCT_DBG = libteamdctl0-dbgsym_$(LIBTEAM_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBTEAMDCT),$(LIBTEAMDCT_DBG)))
|
||||
|
||||
LIBTEAM_UTILS = libteam-utils_$(LIBTEAM_VERSION)_amd64.deb
|
||||
$(LIBTEAM_UTILS)_DEPENDS += $(LIBTEAMDCT)
|
||||
$(eval $(call add_derived_package,$(LIBTEAM),$(LIBTEAM_UTILS)))
|
||||
|
||||
LIBTEAM_UTILS_DBG = libteam-utils-dbgsym_$(LIBTEAM_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBTEAM_UTILS),$(LIBTEAM_UTILS_DBG)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += libteam
|
||||
|
@ -17,4 +17,7 @@ SONIC_STRETCH_DEBS += $(LIBYANG)
|
||||
LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DEV)))
|
||||
|
||||
export LIBYANG LIBYANG_DEV
|
||||
LIBYANG_DBG = libyang$(LIBYANG_VERSION_BASE)-dbgsym_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DBG)))
|
||||
|
||||
export LIBYANG LIBYANG_DEV LIBYANG_DBG
|
||||
|
@ -13,8 +13,17 @@ SONIC_MAKE_DEBS += $(LLDPD)
|
||||
LIBLLDPCTL = liblldpctl-dev_$(LLDPD_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LLDPD),$(LIBLLDPCTL)))
|
||||
|
||||
LLDPD_DBG = lldpd-dbgsym_$(LLDPD_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LLDPD),$(LLDPD_DBG)))
|
||||
|
||||
# Export these variables so they can be used in a sub-make
|
||||
export LLDPD_VERSION
|
||||
export LLDPD_VERSION_FULL
|
||||
export LLDPD
|
||||
export LIBLLDPCTL
|
||||
export LLDPD_DBG
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += lldpd
|
||||
|
@ -6,21 +6,38 @@ LM_SENSORS_VERSION_FULL=$(LM_SENSORS_VERSION)-4
|
||||
LM_SENSORS = lm-sensors_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
$(LM_SENSORS)_SRC_PATH = $(SRC_PATH)/lm-sensors
|
||||
|
||||
LM_SENSORS_DBG = lm-sensors-dbgsym_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LM_SENSORS),$(LM_SENSORS_DBG)))
|
||||
|
||||
FANCONTROL = fancontrol_$(LM_SENSORS_VERSION_FULL)_all.deb
|
||||
$(eval $(call add_derived_package,$(LM_SENSORS),$(FANCONTROL)))
|
||||
|
||||
LIBSENSORS = libsensors4_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LM_SENSORS),$(LIBSENSORS)))
|
||||
|
||||
LIBSENSORS_DBG = libsensors4-dbgsym_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LIBSENSORS),$(LIBSENSORS_DBG)))
|
||||
|
||||
SENSORD = sensord_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(LM_SENSORS),$(SENSORD)))
|
||||
$(SENSORD)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS)
|
||||
|
||||
SENSORD_DBG = sensord-dbgsym_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(SENSORD),$(SENSORD_DBG)))
|
||||
|
||||
SONIC_MAKE_DEBS += $(LM_SENSORS)
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += lm-sensors
|
||||
|
||||
export LM_SENSORS
|
||||
export FANCONTROL
|
||||
export LIBSENSORS
|
||||
export SENSORD
|
||||
export LM_SENSORS_VERSION
|
||||
export LM_SENSORS_VERSION_FULL
|
||||
export LM_SENSORS_DBG
|
||||
export LIBSENSORS_DBG
|
||||
export SENSORD_DBG
|
||||
|
@ -8,3 +8,11 @@ RADVD = radvd_$(RADVD_VERSION)_amd64.deb
|
||||
$(RADVD)_SRC_PATH = $(SRC_PATH)/radvd
|
||||
SONIC_MAKE_DEBS += $(RADVD)
|
||||
SONIC_STRETCH_DEBS += $(RADVD)
|
||||
|
||||
RADVD_DBG = radvd-dbgsym_$(RADVD_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(RADVD),$(RADVD_DBG)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += radvd
|
||||
|
@ -9,8 +9,16 @@ SONIC_MAKE_DEBS += $(REDIS_TOOLS)
|
||||
REDIS_SERVER = redis-server_$(REDIS_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_SERVER)))
|
||||
|
||||
REDIS_SERVER_DBG = redis-server-dbgsym_$(REDIS_VERSION)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(REDIS_SERVER),$(REDIS_SERVER_DBG)))
|
||||
|
||||
REDIS_SENTINEL = redis-sentinel_$(REDIS_VERSION)_amd64.deb
|
||||
$(REDIS_SENTINEL)_DEPENDS += $(REDIS_SERVER)
|
||||
$(REDIS_SENTINEL)_RDEPENDS += $(REDIS_SERVER)
|
||||
$(eval $(call add_derived_package,$(REDIS_TOOLS),$(REDIS_SENTINEL)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += redis
|
||||
|
||||
|
@ -59,3 +59,9 @@ LIBSAIMETADATA_DBG = libsaimetadata-dbg_1.0.0_amd64.deb
|
||||
$(LIBSAIMETADATA_DBG)_DEPENDS += $(LIBSAIMETADATA)
|
||||
$(LIBSAIMETADATA_DBG)_RDEPENDS += $(LIBSAIMETADATA)
|
||||
$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA_DBG)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += sonic-sairedis
|
||||
|
||||
|
@ -26,6 +26,12 @@ $(SNMPD)_DEPENDS += $(LIBSNMP)
|
||||
$(SNMPD)_RDEPENDS += $(LIBSNMP)
|
||||
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(SNMPD)))
|
||||
|
||||
SNMP_DBG = snmp-dbgsym_$(SNMPD_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(SNMP),$(SNMP_DBG)))
|
||||
|
||||
SNMPD_DBG = snmpd-dbgsym_$(SNMPD_VERSION_FULL)_amd64.deb
|
||||
$(eval $(call add_derived_package,$(SNMPD),$(SNMPD_DBG)))
|
||||
|
||||
LIBSNMP = libsnmp30_$(SNMPD_VERSION_FULL)_amd64.deb
|
||||
$(LIBSNMP)_RDEPENDS += $(LIBSNMP_BASE)
|
||||
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(LIBSNMP)))
|
||||
@ -53,3 +59,9 @@ TKMIB = tkmib_$(SNMPD_VERSION_FULL)_all.deb
|
||||
$(TKMIB)_DEPENDS += $(LIBSNMP_PERL)
|
||||
$(TKMIB)_RDEPENDS += $(LIBSNMP_PERL)
|
||||
$(eval $(call add_derived_package,$(LIBSNMP_BASE),$(TKMIB)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += snmpd
|
||||
|
||||
|
@ -19,3 +19,9 @@ LIBSWSSCOMMON_DBG = libswsscommon-dbg_1.0.0_amd64.deb
|
||||
$(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON)
|
||||
$(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON)
|
||||
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DBG)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += sonic-swss-common
|
||||
|
||||
|
@ -11,3 +11,9 @@ SWSS_DBG = swss-dbg_1.0.0_amd64.deb
|
||||
$(SWSS_DBG)_DEPENDS += $(SWSS)
|
||||
$(SWSS_DBG)_RDEPENDS += $(SWSS)
|
||||
$(eval $(call add_derived_package,$(SWSS),$(SWSS_DBG)))
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += swss
|
||||
|
||||
|
@ -30,3 +30,8 @@ $(LIBNSS_TACPLUS)_SRC_PATH = $(SRC_PATH)/tacacs/nss
|
||||
SONIC_MAKE_DEBS += $(LIBNSS_TACPLUS)
|
||||
|
||||
SONIC_STRETCH_DEBS += $(LIBPAM_TACPLUS) $(LIBNSS_TACPLUS)
|
||||
|
||||
# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
|
||||
# are archived into debug one image to facilitate debugging.
|
||||
#
|
||||
DBG_SRC_ARCHIVE += tacacs
|
||||
|
9
scripts/dbg_files.sh
Executable file
9
scripts/dbg_files.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Provide file paths to archive for debug image as relative to src subdir
|
||||
#
|
||||
for i in $debug_src_archive
|
||||
do
|
||||
find $i/ -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -type f
|
||||
done
|
||||
|
5
slave.mk
5
slave.mk
@ -581,6 +581,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
|
||||
.platform \
|
||||
onie-image.conf \
|
||||
build_debian.sh \
|
||||
scripts/dbg_files.sh \
|
||||
build_image.sh \
|
||||
$$(addsuffix -install,$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_DEPENDS))) \
|
||||
$$(addprefix $(STRETCH_DEBS_PATH)/,$$($$*_INSTALLS)) \
|
||||
@ -621,6 +622,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
|
||||
export swsssdk_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SWSSSDK_PY2))"
|
||||
export platform_common_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY2))"
|
||||
export redis_dump_load_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2))"
|
||||
export install_debug_image="$(INSTALL_DEBUG_TOOLS)"
|
||||
|
||||
$(foreach docker, $($*_DOCKERS),\
|
||||
export docker_image="$(docker)"
|
||||
@ -649,6 +651,9 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
|
||||
chmod +x sonic_debian_extension.sh,
|
||||
)
|
||||
|
||||
export debug_src_archive="$(DBG_SRC_ARCHIVE)"
|
||||
|
||||
DEBUG_IMG="$(INSTALL_DEBUG_TOOLS)" \
|
||||
USERNAME="$(USERNAME)" \
|
||||
PASSWORD="$(PASSWORD)" \
|
||||
./build_debian.sh $(LOG)
|
||||
|
@ -3,6 +3,7 @@ SHELL = /bin/bash
|
||||
.SHELLFLAGS += -e
|
||||
|
||||
MAIN_TARGET = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb
|
||||
DERIVED_TARGETS = isc-dhcp-relay-dbgsym_$(ISC_DHCP_VERSION)_amd64.deb
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
# Remove any stale files
|
||||
@ -26,4 +27,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
popd
|
||||
|
||||
# Move the newly-built .deb packages to the destination directory
|
||||
mv $* $(DEST)/
|
||||
mv $(DERIVED_TARGETS) $* $(DEST)/
|
||||
|
||||
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
|
||||
|
@ -5,7 +5,10 @@ SHELL = /bin/bash
|
||||
MAIN_TARGET = libteam5_$(LIBTEAM_VERSION)_amd64.deb
|
||||
DERIVED_TARGETS = libteam-dev_$(LIBTEAM_VERSION)_amd64.deb \
|
||||
libteamdctl0_$(LIBTEAM_VERSION)_amd64.deb \
|
||||
libteam-utils_$(LIBTEAM_VERSION)_amd64.deb
|
||||
libteam-utils_$(LIBTEAM_VERSION)_amd64.deb \
|
||||
libteam5-dbgsym_$(LIBTEAM_VERSION)_amd64.deb \
|
||||
libteamdctl0-dbgsym_$(LIBTEAM_VERSION)_amd64.deb \
|
||||
libteam-utils-dbgsym_$(LIBTEAM_VERSION)_amd64.deb
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
# Obtain libteam
|
||||
|
@ -3,7 +3,7 @@ SHELL = /bin/bash
|
||||
.SHELLFLAGS += -e
|
||||
|
||||
MAIN_TARGET = $(LIBYANG)
|
||||
DERIVED_TARGETS = $(LIBYANG_DEV)
|
||||
DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG)
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
rm -fr ./libyang-$(LIBYANG_VERSION)
|
||||
|
@ -3,7 +3,7 @@ SHELL = /bin/bash
|
||||
.SHELLFLAGS += -e
|
||||
|
||||
MAIN_TARGET = $(LLDPD)
|
||||
DERIVED_TARGETS = $(LIBLLDPCTL)
|
||||
DERIVED_TARGETS = $(LIBLLDPCTL) $(LLDPD_DBG)
|
||||
|
||||
LLDP_URL = http://ftp.debian.org/debian/pool/main/l/lldpd
|
||||
|
||||
|
@ -6,7 +6,10 @@ SHELL = /bin/bash
|
||||
MAIN_TARGET = $(LM_SENSORS)
|
||||
DERIVED_TARGETS = fancontrol_$(LM_SENSORS_VERSION_FULL)_all.deb \
|
||||
libsensors4_$(LM_SENSORS_VERSION_FULL)_amd64.deb \
|
||||
sensord_$(LM_SENSORS_VERSION_FULL)_amd64.deb
|
||||
sensord_$(LM_SENSORS_VERSION_FULL)_amd64.deb \
|
||||
$(LM_SENSORS_DBG) \
|
||||
$(LIBSENSORS_DBG) \
|
||||
$(SENSORD_DBG)
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
rm -rf lm-sensors-$(LM_SENSORS_VERSION)
|
||||
|
@ -3,6 +3,7 @@ SHELL = /bin/bash
|
||||
.SHELLFLAGS += -e
|
||||
|
||||
MAIN_TARGET = radvd_$(RADVD_VERSION)_amd64.deb
|
||||
DERIVED_TARGETS = radvd-dbgsym_$(RADVD_VERSION)_amd64.deb
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
# Remove any stale files
|
||||
@ -28,4 +29,4 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
popd
|
||||
|
||||
# Move the newly-built .deb package to the destination directory
|
||||
mv $* $(DEST)/
|
||||
mv $(DERIVED_TARGETS) $* $(DEST)/
|
||||
|
@ -7,7 +7,8 @@ REDIS_VERSION_FULL = $(REDIS_VERSION)-1~bpo8+1
|
||||
|
||||
MAIN_TARGET = redis-server_$(REDIS_VERSION_FULL)_amd64.deb
|
||||
DERIVED_TARGETS = redis-tools_$(REDIS_VERSION_FULL)_amd64.deb \
|
||||
redis-sentinel_$(REDIS_VERSION_FULL)_amd64.deb
|
||||
redis-sentinel_$(REDIS_VERSION_FULL)_amd64.deb \
|
||||
redis-server-dbgsym_$(REDIS_VERSION_FULL)_amd64.deb
|
||||
|
||||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
||||
rm -rf redis_build
|
||||
|
@ -6,6 +6,8 @@ MAIN_TARGET = libsnmp-base_$(SNMPD_VERSION_FULL)_all.deb
|
||||
DERIVED_TARGETS = snmptrapd_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
snmp_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
snmpd_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
snmp-dbgsym_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
snmpd-dbgsym_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
libsnmp30_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
libsnmp30-dbg_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
libsnmp-dev_$(SNMPD_VERSION_FULL)_amd64.deb \
|
||||
|
Loading…
Reference in New Issue
Block a user