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

Add support for bcmsh and bcmcmd utlitites in multi ASIC devices #4926

Merged
merged 1 commit into from
Jul 9, 2020
Merged
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
5 changes: 5 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ start() {
--tmpfs /tmp \
{%- endif %}
{%- endif %}
{%- if sonic_asic_platform == "broadcom" %}
{%- if docker_container_name == "syncd" %}
-v /var/run/docker-syncd$DEV:/var/run/sswsyncd \
{%- endif %}
{%- endif %}
{%- if docker_container_name == "bgp" %}
-v /etc/sonic/frr/$DEV:/etc/frr:rw \
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/docker-syncd-brcm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG)

$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot
$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd

$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd
$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh
$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += bcm_common:/usr/bin/bcm_common
$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d
40 changes: 40 additions & 0 deletions platform/broadcom/docker-syncd-brcm/base_image_files/bcm_common
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

function help()
{
echo "Usage: $0 -n [0 to $(($NUM_ASIC-1))]" 1>&2; exit 1;

}


DEV=""

PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`

# Parse the device specific asic conf file, if it exists

ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf
if [ -f "$ASIC_CONF" ]; then
source $ASIC_CONF
fi


if [[ ($NUM_ASIC -gt 1) ]]; then
OPTIND=1

while getopts ":n:h:" opt; do
case "${opt}" in
h) help
exit 0
;;
n) DEV=${OPTARG}
[ $DEV -lt $NUM_ASIC -a $DEV -ge 0 ] || help
;;
esac
done
shift "$((OPTIND-1))"

if [ -z "${DEV}" ]; then
help
fi
fi
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash

docker exec -i syncd bcmcmd "$@"
BCM_COMMON=/usr/bin/bcm_common
if [ -f "$BCM_COMMON" ]; then
source $BCM_COMMON
fi
docker exec -i syncd$DEV bcmcmd "$@"

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash

docker exec -it syncd bcmsh "$@"
BCM_COMMON=/usr/bin/bcm_common
if [ -f "$BCM_COMMON" ]; then
source $BCM_COMMON
fi

docker exec -it syncd$DEV bcmsh "$@"