2017-05-08 17:43:31 -05:00
|
|
|
#!/usr/bin/env bash
|
2016-07-26 14:01:58 -05:00
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
mkdir -p /etc/swss/config.d/
|
2017-04-21 16:28:30 -05:00
|
|
|
|
2020-08-17 17:47:52 -05:00
|
|
|
CFGGEN_PARAMS=" \
|
|
|
|
-d \
|
|
|
|
-y /etc/sonic/constants.yml \
|
|
|
|
-t /usr/share/sonic/templates/switch.json.j2,/etc/swss/config.d/switch.json \
|
|
|
|
-t /usr/share/sonic/templates/ipinip.json.j2,/etc/swss/config.d/ipinip.json \
|
|
|
|
-t /usr/share/sonic/templates/ports.json.j2,/etc/swss/config.d/ports.json \
|
|
|
|
-t /usr/share/sonic/templates/vlan_vars.j2 \
|
2020-10-05 10:48:13 -05:00
|
|
|
-t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \
|
2022-03-04 22:40:29 -06:00
|
|
|
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
|
2020-08-17 17:47:52 -05:00
|
|
|
"
|
|
|
|
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)
|
2022-08-05 13:33:37 -05:00
|
|
|
SUBTYPE=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['subtype']")
|
2017-02-02 22:34:34 -06:00
|
|
|
|
2022-03-04 22:40:29 -06:00
|
|
|
chmod +x /usr/bin/wait_for_link.sh
|
|
|
|
|
2021-12-17 10:43:25 -06:00
|
|
|
# Executed platform specific initialization tasks.
|
|
|
|
if [ -x /usr/share/sonic/platform/platform-init ]; then
|
|
|
|
/usr/share/sonic/platform/platform-init
|
|
|
|
fi
|
|
|
|
|
2018-09-24 16:56:37 -05:00
|
|
|
# Executed HWSKU specific initialization tasks.
|
|
|
|
if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then
|
|
|
|
/usr/share/sonic/hwsku/hwsku-init
|
|
|
|
fi
|
|
|
|
|
2020-10-05 10:48:13 -05:00
|
|
|
# Start arp_update and NDP proxy daemon when VLAN exists
|
2017-05-15 19:06:19 -05:00
|
|
|
if [ "$VLAN" != "" ]; then
|
2020-09-17 20:33:10 -05:00
|
|
|
cp /usr/share/sonic/templates/arp_update.conf /etc/supervisor/conf.d/
|
2020-10-05 10:48:13 -05:00
|
|
|
cp /usr/share/sonic/templates/ndppd.conf /etc/supervisor/conf.d/
|
2017-05-15 19:06:19 -05:00
|
|
|
fi
|
2020-05-15 19:09:16 -05:00
|
|
|
|
2022-08-05 13:33:37 -05:00
|
|
|
if [ "$SUBTYPE" == "DualToR" ]; then
|
|
|
|
cp /usr/share/sonic/templates/tunnel_packet_handler.conf /etc/supervisor/conf.d/
|
|
|
|
fi
|
|
|
|
|
2020-11-22 23:18:44 -06:00
|
|
|
exec /usr/local/bin/supervisord
|