2017-05-08 17:43:31 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-07-25 02:05:27 -05:00
|
|
|
# Export platform information. Required to be able to write
|
|
|
|
# vendor specific code.
|
2017-10-25 19:57:28 -05:00
|
|
|
export platform=`sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type`
|
2017-05-08 17:43:31 -05:00
|
|
|
|
|
|
|
MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'`
|
|
|
|
|
2017-05-26 19:56:29 -05:00
|
|
|
# Create a folder for SsWW record files
|
|
|
|
mkdir -p /var/log/swss
|
|
|
|
ORCHAGENT_ARGS="-d /var/log/swss "
|
2017-05-08 17:43:31 -05:00
|
|
|
|
2017-06-04 03:35:47 -05:00
|
|
|
# Set orchagent pop batch size to 8192
|
|
|
|
ORCHAGENT_ARGS+="-b 8192 "
|
|
|
|
|
2017-06-03 15:49:33 -05:00
|
|
|
# Add platform specific arguments if necessary
|
2017-10-25 19:57:28 -05:00
|
|
|
if [ "$platform" == "broadcom" ]; then
|
2017-05-08 17:43:31 -05:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2017-10-25 19:57:28 -05:00
|
|
|
elif [ "$platform" == "cavium" ]; then
|
2017-05-24 13:59:01 -05:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2018-03-13 21:06:21 -05:00
|
|
|
elif [ "$platform" == "nephos" ]; then
|
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2017-11-07 13:12:40 -06:00
|
|
|
elif [ "$platform" == "barefoot" ]; then
|
2017-11-02 19:11:14 -05:00
|
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
2017-05-08 17:43:31 -05:00
|
|
|
fi
|
|
|
|
|
2017-05-11 13:18:10 -05:00
|
|
|
exec /usr/bin/orchagent ${ORCHAGENT_ARGS}
|