sonic-buildimage/platform/vs/docker-sonic-vs/orchagent.sh
Sudharsan Dhamal Gopalarathnam 738de2dcab
[docker-sonic-vs] Removing fake_platform variable since it is no more used (#9175)
*Removing fake_platform environment variable. Following the merge of #9044 and Azure/sonic-swss#1978 the fake_platform environment variable is not used in any place and removing the stale references.

Signed-off-by: Sudharsan Dhamal Gopalarathnam <sudharsand@nvidia.com>
2021-11-05 16:48:13 -07:00

39 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
#This is required since we have platform based checks in orchagent
if [ "$HWSKU" == "Mellanox-SN2700" ]; then
export platform="mellanox"
else
export platform=vs
fi
SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2
# Retrieve SWSS vars from sonic-cfggen
SWSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $SWSS_VARS_FILE) || exit 1
MAC_ADDRESS=$(echo $SWSS_VARS | jq -r '.mac')
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
logger "Mac address not found in Device Metadata, Falling back to eth0"
fi
# Create a folder for SwSS record files
mkdir -p /var/log/swss
ORCHAGENT_ARGS="-d /var/log/swss "
# Set orchagent pop batch size to 8192
ORCHAGENT_ARGS+="-b 8192 "
# Set synchronous mode if it is enabled in CONFIG_DB
SYNC_MODE=$(echo $SWSS_VARS | jq -r '.synchronous_mode')
if [ "$SYNC_MODE" == "enable" ]; then
ORCHAGENT_ARGS+="-s "
fi
# Set mac address
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
exec /usr/bin/orchagent ${ORCHAGENT_ARGS}