2017-05-11 13:18:10 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-10-04 03:02:30 -05:00
|
|
|
set -e
|
|
|
|
|
2017-05-24 13:57:33 -05:00
|
|
|
function fast_reboot {
|
|
|
|
case "$(cat /proc/cmdline)" in
|
|
|
|
*fast-reboot*)
|
|
|
|
if [[ -f /fdb.json ]];
|
|
|
|
then
|
|
|
|
swssconfig /fdb.json
|
|
|
|
rm -f /fdb.json
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -f /arp.json ]];
|
|
|
|
then
|
|
|
|
swssconfig /arp.json
|
|
|
|
rm -f /arp.json
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
# Restore FDB and ARP table ASAP
|
|
|
|
fast_reboot
|
|
|
|
|
2017-09-18 19:23:19 -05:00
|
|
|
HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -d -v "DEVICE_METADATA['localhost']['hwsku']"`
|
2017-05-11 13:18:10 -05:00
|
|
|
|
2017-11-02 17:09:27 -05:00
|
|
|
SWSSCONFIG_ARGS="00-copp.config.json ipinip.json ports.json switch.json "
|
2017-05-11 13:18:10 -05:00
|
|
|
|
|
|
|
if [ "$HWSKU" == "Force10-S6000" ]; then
|
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json "
|
2017-05-24 13:59:01 -05:00
|
|
|
elif [ "$HWSKU" == "Force10-S6000-Q32" ]; then
|
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json "
|
2017-11-13 13:30:16 -06:00
|
|
|
elif [ "$HWSKU" == "Force10-S6100" ]; then
|
|
|
|
SWSSCONFIG_ARGS+="th.64ports.buffers.json th.64ports.qos.json "
|
2017-05-11 13:18:10 -05:00
|
|
|
elif [ "$HWSKU" == "Arista-7050-QX32" ]; then
|
|
|
|
SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json "
|
2017-09-29 16:44:55 -05:00
|
|
|
elif [[ "$HWSKU" == "ACS-MSN27"* ]]; then
|
|
|
|
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/msn27xx.32ports.buffers.json.j2 > /etc/swss/config.d/msn27xx.32ports.buffers.json
|
2017-11-22 10:58:22 -06:00
|
|
|
SWSSCONFIG_ARGS+="msn27xx.32ports.buffers.json "
|
2017-05-11 13:18:10 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
for file in $SWSSCONFIG_ARGS; do
|
|
|
|
swssconfig /etc/swss/config.d/$file
|
|
|
|
sleep 1
|
|
|
|
done
|