Skip to content

Commit 3ad830e

Browse files
authored
New sonic-buildimage images for Broadcom DNX ASIC family. (#7598)
Introduce new sonic-buildimage images for Broadcom DNX ASIC family. sonic-broadcom-dnx.bin sonic-aboot-broadcom-dnx.swi How I did it NO CHANGE to existing make commands make init; make configure PLATFORM=broadcom; make target/sonic-aboot-broadcom.swi; make target/sonic-broadcom.bin The difference now is that it will result in new broadcom images for DNX asic family as well. sonic-broadcom.bin, sonic-broadcom-dnx.bin sonic-aboot-broadcom.swi, sonic-aboot-broadcom-dnx.swi Note: This PR also adds support for Broadcom SAI 5.0 (based on 1.8 SAI ) for DNX based platform + changes in platform x86_64-arista_7280cr3_32p4 bcm config files and platform_env.conf files
1 parent 8b3fabe commit 3ad830e

40 files changed

+577
-47
lines changed

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,7 @@
8888
[submodule "src/wpasupplicant/sonic-wpa-supplicant"]
8989
path = src/wpasupplicant/sonic-wpa-supplicant
9090
url = https://github.com/Azure/sonic-wpa-supplicant.git
91+
[submodule "platform/broadcom/saibcm-modules-dnx"]
92+
path = platform/broadcom/saibcm-modules-dnx
93+
url = https://github.com/Azure/saibcm-modules.git
94+
branch = sdk-6.5.22-gpl-dnx

device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm

+4-3
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ tdma_timeout_usec.BCM8869X=1000000
273273
tslam_timeout_usec.BCM8869X=1000000
274274

275275
appl_enable_intr_init.BCM8869X=1
276-
polled_irq_mode.BCM8869X=1
276+
polled_irq_mode.BCM8869X=0
277277
polled_irq_delay.BCM8869X=1000
278278

279-
bcm_stat_interval.BCM8869X=1000
279+
bcm_stat_interval.BCM8869X=1000000
280280

281281
mem_cache_enable_ecc.BCM8869X=1
282282
mem_cache_enable_parity.BCM8869X=1
@@ -750,7 +750,8 @@ ucode_port_38=CGE23:core_1.38
750750
ucode_port_39=CGE20:core_1.39
751751
ucode_port_40=CGE21:core_1.40
752752

753-
rif_id_max=0x4000
753+
rif_id_max=0x6000
754+
dpp_db_path=/usr/share/bcm/db
754755

755756
dma_desc_aggregator_chain_length_max.BCM8869X=1000
756757
dma_desc_aggregator_buff_size_kb.BCM8869X=100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usemsi=1

files/build_templates/sonic_debian_extension.j2

+16-2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-ztp_*.deb || \
285285
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
286286
{% endif %}
287287

288+
{% for machine_debs in lazy_build_installer_debs.strip().split() -%}
289+
{% set machine, pkgname = machine_debs.split('|') %}
290+
if [[ -z "{{machine}}" || -n "{{machine}}" && $TARGET_MACHINE == "{{machine}}" ]]; then
291+
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/{{pkgname}} || \
292+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
293+
fi
294+
{% endfor %}
295+
288296
# Install SONiC Device Data (and its dependencies via 'apt-get -y install -f')
289297
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-device-data_*.deb || \
290298
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
@@ -653,10 +661,11 @@ sudo mount --bind target $FILESYSTEM_ROOT/target
653661
sudo chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS info
654662

655663
{% for docker_installation_target in installer_images.strip().split() -%}
656-
{% set pkgname, docker_build_path, image = docker_installation_target.split('|') %}
664+
{% set pkgname, docker_build_path, machine, image = docker_installation_target.split('|') %}
657665
{% set imagefilepath = image.split(':')|first -%}
658666
{% set imagefilename = imagefilepath.split('/')|last -%}
659667
{% set imagename = imagefilename.split('.')|first -%}
668+
if [[ -z "{{machine}}" || -n "{{machine}}" && $TARGET_MACHINE == "{{machine}}" ]]; then
660669
sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS load -i {{imagefilepath}}
661670
sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS tag {{imagename}}:latest {{imagename}}:"${SONIC_IMAGE_VERSION}"
662671
# Check if manifest exists for {{imagename}} and it is a valid JSON
@@ -671,6 +680,7 @@ jq -e . /tmp/manifest.json || {
671680
sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS tag {{imagename}}:latest {{imagebasename}}:"${SONIC_IMAGE_VERSION}"
672681
sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS tag {{imagename}}:latest {{imagebasename}}:latest
673682
{% endif %}
683+
fi
674684
{% endfor %}
675685

676686
SONIC_PACKAGE_MANAGER_FOLDER="/var/lib/sonic-package-manager/"
@@ -714,7 +724,11 @@ sudo bash -c "echo { > $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_name
714724
sudo bash -c "echo } >> $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_names.json"
715725

716726
{% for script in installer_start_scripts.split(' ') -%}
717-
sudo cp {{script}} $FILESYSTEM_ROOT/usr/bin/
727+
if [ -f $TARGET_MACHINE"_{{script}}" ]; then
728+
sudo cp $TARGET_MACHINE"_{{script}}" $FILESYSTEM_ROOT/usr/bin/{{script}}
729+
else
730+
sudo cp {{script}} $FILESYSTEM_ROOT/usr/bin/
731+
fi
718732
{% endfor %}
719733
{% for service in installer_services.split(' ') -%}
720734
if [ -f {{service}} ]; then

onie-image-arm64.conf

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
ONIEIMAGE_VERSION=r0
1414

15+
## Filesystem root
16+
FILESYSTEM_ROOT=./fsroot-${TARGET_MACHINE}
17+
1518
## Filename for squashfs file system
1619
FILESYSTEM_SQUASHFS=fs.squashfs
1720

onie-image-armhf.conf

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
ONIEIMAGE_VERSION=r0
1414

15+
## Filesystem root
16+
FILESYSTEM_ROOT=./fsroot-${TARGET_MACHINE}
17+
1518
## Filename for squashfs file system
1619
FILESYSTEM_SQUASHFS=fs.squashfs
1720

onie-image.conf

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
ONIEIMAGE_VERSION=r0
1414

15+
## Filesystem root
16+
FILESYSTEM_ROOT=./fsroot-${TARGET_MACHINE}
17+
1518
## Filename for squashfs file system
1619
FILESYSTEM_SQUASHFS=fs.squashfs
1720

onie-mk-demo.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ fi
4040
}
4141

4242
[ -r "$platform_conf" ] || {
43-
echo "Error: Unable to read installer platform configuration file: $platform_conf"
44-
exit 1
43+
echo "Warning: Unable to read installer platform configuration file: $platform_conf"
4544
}
4645

4746
[ $# -gt 0 ] || {
@@ -98,7 +97,9 @@ sed -i -e "s/%%DEMO_TYPE%%/$demo_type/g" \
9897
echo -n "."
9998
cp -r $* $tmp_installdir || clean_up 1
10099
echo -n "."
101-
cp $platform_conf $tmp_installdir || clean_up 1
100+
[ -r "$platform_conf" ] && {
101+
cp $platform_conf $tmp_installdir || clean_up 1
102+
}
102103
echo "machine=$machine" > $tmp_installdir/machine.conf
103104
echo "platform=$platform" >> $tmp_installdir/machine.conf
104105
echo -n "."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
DPATH := $($(DOCKER_SYNCD_BRCM_DNX_RPC)_PATH)
3+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc.mk $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc.dep
4+
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
5+
DEP_FILES += $(shell git ls-files $(DPATH))
6+
7+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_CACHE_MODE := GIT_CONTENT_SHA
8+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
9+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEP_FILES := $(DEP_FILES)
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# docker image for brcm syncd with rpc
2+
3+
DOCKER_SYNCD_BRCM_DNX_RPC = docker-syncd-brcm-dnx-rpc.gz
4+
DOCKER_SYNCD_DNX_BASE = docker-syncd-brcm-dnx.gz
5+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc
6+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF)
7+
ifeq ($(INSTALL_DEBUG_TOOLS), y)
8+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \
9+
$(LIBSWSSCOMMON_DBG) \
10+
$(LIBSAIMETADATA_DBG) \
11+
$(LIBSAIREDIS_DBG)
12+
endif
13+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_FILES += $(DSSERVE) $(BCMCMD) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
14+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_DNX_BASE)
15+
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_DNX_RPC)
16+
ifeq ($(ENABLE_SYNCD_RPC),y)
17+
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_DNX_RPC)
18+
endif
19+
20+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_CONTAINER_NAME = syncd
21+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_VERSION = 1.0.0-rpc
22+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_PACKAGE_NAME = syncd-dnx
23+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += --privileged -t
24+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
25+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot
26+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
27+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
28+
29+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd
30+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh
31+
$(DOCKER_SYNCD_BRCM_DNX_RPC)_MACHINE = broadcom-dnx
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM docker-syncd-brcm-dnx
2+
3+
## Make apt-get non-interactive
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
COPY \
7+
{% for deb in docker_syncd_brcm_dnx_rpc_debs.split(' ') -%}
8+
debs/{{ deb }}{{' '}}
9+
{%- endfor -%}
10+
debs/
11+
12+
RUN apt-get purge -y syncd
13+
14+
## Pre-install the fundamental packages
15+
RUN apt-get update \
16+
&& apt-get -y install \
17+
net-tools \
18+
python-pip \
19+
python-setuptools \
20+
build-essential \
21+
libssl-dev \
22+
libffi-dev \
23+
python-dev \
24+
wget \
25+
cmake \
26+
libqt5core5a \
27+
libqt5network5 \
28+
libboost-atomic1.71.0
29+
30+
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
31+
{% for deb in docker_syncd_brcm_dnx_rpc_debs.split(' ') -%}
32+
dpkg_apt debs/{{ deb }}{{'; '}}
33+
{%- endfor %}
34+
35+
RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
36+
&& tar xvfz 1.0.0.tar.gz \
37+
&& cd nanomsg-1.0.0 \
38+
&& mkdir -p build \
39+
&& cmake . \
40+
&& make install \
41+
&& ldconfig \
42+
&& cd .. \
43+
&& rm -fr nanomsg-1.0.0 \
44+
&& rm -f 1.0.0.tar.gz \
45+
&& pip2 install cffi==1.7.0 \
46+
&& pip2 install --upgrade cffi==1.7.0 \
47+
&& pip2 install wheel \
48+
&& pip2 install nnpy \
49+
&& mkdir -p /opt \
50+
&& cd /opt \
51+
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
52+
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
53+
&& rm -rf /root/deps
54+
55+
COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]
56+
57+
ENTRYPOINT ["/usr/local/bin/supervisord"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker exec -i syncd bcmcmd "$@"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker exec -it syncd bcmsh "$@"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[program:ptf_nn_agent]
2+
command=/usr/bin/python /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-iface-rcv-buffer=109430400
3+
process_name=ptf_nn_agent
4+
stdout_logfile=/tmp/ptf_nn_agent.out.log
5+
stderr_logfile=/tmp/ptf_nn_agent.err.log
6+
redirect_stderr=false
7+
autostart=true
8+
autorestart=true
9+
startsecs=1
10+
numprocs=1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#DPKG FRK
2+
DOCKER_SYNCD_DNX_BASE = docker-syncd-brcm-dnx.gz
3+
DOCKER_SYNCD_DNX_BASE_DBG = docker-syncd-brcm-dnx-$(DBG_IMAGE_MARK).gz
4+
DPATH := $($(DOCKER_SYNCD_DNX_BASE)_PATH)
5+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/docker-syncd-brcm-dnx.mk platform/broadcom/docker-syncd-brcm-dnx.dep platform/broadcom/sai.mk
6+
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
7+
DEP_FILES += $(shell git ls-files $(DPATH))
8+
9+
$(DOCKER_SYNCD_DNX_BASE)_CACHE_MODE := GIT_CONTENT_SHA
10+
$(DOCKER_SYNCD_DNX_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
11+
$(DOCKER_SYNCD_DNX_BASE)_DEP_FILES := $(DEP_FILES)
12+
13+
$(eval $(call add_dbg_docker,$(DOCKER_SYNCD_DNX_BASE),$(DOCKER_SYNCD_DNX_BASE_DBG)))
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# docker image for brcm-dnx syncd
2+
3+
DOCKER_SYNCD_DNX_BASE = docker-syncd-brcm-dnx.gz
4+
DOCKER_SYNCD_DNX_BASE_DBG = docker-syncd-brcm-dnx-$(DBG_IMAGE_MARK).gz
5+
DOCKER_SYNCD_DNX_PLATFORM_CODE = brcm-dnx
6+
7+
$(DOCKER_SYNCD_DNX_BASE)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_DNX_PLATFORM_CODE)
8+
$(DOCKER_SYNCD_DNX_BASE)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
9+
10+
$(DOCKER_SYNCD_DNX_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER)
11+
$(DOCKER_SYNCD_DNX_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS)
12+
$(DOCKER_SYNCD_DNX_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES)
13+
14+
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_DNX_BASE)
15+
ifneq ($(ENABLE_SYNCD_RPC),y)
16+
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_DNX_BASE)
17+
endif
18+
19+
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_DNX_BASE_DBG)
20+
ifneq ($(ENABLE_SYNCD_RPC),y)
21+
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_DNX_BASE_DBG)
22+
endif
23+
24+
25+
$(DOCKER_SYNCD_DNX_BASE)_DEPENDS += $(SYNCD)
26+
$(DOCKER_SYNCD_DNX_BASE)_DEPENDS += $(BRCM_DNX_SAI)
27+
$(DOCKER_SYNCD_DNX_BASE)_FILES += $(DSSERVE) $(BCMCMD)
28+
29+
ifeq ($(INSTALL_DEBUG_TOOLS), y)
30+
$(DOCKER_SYNCD_DNX_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \
31+
$(LIBSWSSCOMMON_DBG) \
32+
$(LIBSAIMETADATA_DBG) \
33+
$(LIBSAIREDIS_DBG)
34+
endif
35+
36+
$(DOCKER_SYNCD_DNX_BASE)_VERSION = 1.0.0
37+
$(DOCKER_SYNCD_DNX_BASE)_PACKAGE_NAME = syncd-dnx
38+
$(DOCKER_SYNCD_DNX_BASE)_MACHINE = broadcom-dnx
39+
$(DOCKER_SYNCD_DNX_BASE)_AFTER = $(DOCKER_SYNCD_BASE)
40+
$(DOCKER_SYNCD_DNX_BASE)_CONTAINER_NAME = syncd
41+
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += --privileged -t
42+
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
43+
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
44+
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot
45+
46+
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd
47+
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh
48+
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += bcm_common:/usr/bin/bcm_common
49+
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
2+
FROM docker-config-engine-buster
3+
4+
ARG docker_container_name
5+
6+
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
7+
8+
## Make apt-get non-interactive
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
RUN apt-get update
12+
13+
COPY \
14+
{% for deb in docker_syncd_brcm_dnx_debs.split(' ') -%}
15+
debs/{{ deb }}{{' '}}
16+
{%- endfor -%}
17+
debs/
18+
19+
# Install locally-built Debian packages and implicitly install their dependencies
20+
{{ install_debian_packages(docker_syncd_brcm_dnx_debs.split(' ')) }}
21+
22+
## TODO: add kmod into Depends
23+
RUN apt-get install -yf kmod
24+
25+
## BRCM uses ethtool to set host interface speed
26+
RUN apt-get install -y ethtool
27+
28+
COPY ["files/dsserve", "files/bcmcmd", "start.sh", "start_led.sh", "bcmsh", "/usr/bin/"]
29+
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd
30+
31+
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
32+
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
33+
COPY ["critical_processes", "/etc/supervisor/"]
34+
35+
## Clean up
36+
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
37+
RUN rm -rf /debs
38+
39+
ENTRYPOINT ["/usr/local/bin/supervisord"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
function help()
4+
{
5+
echo "Usage: $0 -n [0 to $(($NUM_ASIC-1))]" 1>&2; exit 1;
6+
7+
}
8+
9+
10+
DEV=""
11+
12+
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
13+
14+
# Parse the device specific asic conf file, if it exists
15+
16+
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf
17+
if [ -f "$ASIC_CONF" ]; then
18+
source $ASIC_CONF
19+
fi
20+
21+
22+
if [[ ($NUM_ASIC -gt 1) ]]; then
23+
OPTIND=1
24+
25+
while getopts ":n:h:" opt; do
26+
case "${opt}" in
27+
h) help
28+
exit 0
29+
;;
30+
n) DEV=${OPTARG}
31+
[ $DEV -lt $NUM_ASIC -a $DEV -ge 0 ] || help
32+
;;
33+
esac
34+
done
35+
shift "$((OPTIND-1))"
36+
37+
if [ -z "${DEV}" ]; then
38+
help
39+
fi
40+
fi

0 commit comments

Comments
 (0)