forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for bcmsh and bcmcmd utlitites in multi ASIC devices (son…
…ic-net#4926) Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com> This PR has changes to support accessing the bcmsh and bcmcmd utilities on multi ASIC devices Changes done - move the link of /var/run/sswsyncd from docker-syncd-brcm.mk to docker_image_ctl.j2 - update the bcmsh and bcmcmd scripts to take -n [ASIC_ID] as an argument on multi ASIC platforms
- Loading branch information
1 parent
c213bcf
commit a46f4c9
Showing
5 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
platform/broadcom/docker-syncd-brcm/base_image_files/bcm_common
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |