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/
|
2021-06-09 12:53:47 -05:00
|
|
|
mkdir -p /etc/supervisor/
|
|
|
|
mkdir -p /etc/supervisor/conf.d/
|
2017-04-21 16:28:30 -05:00
|
|
|
|
2020-08-17 17:47:52 -05:00
|
|
|
CFGGEN_PARAMS=" \
|
|
|
|
-d \
|
2022-02-09 05:29:18 -06:00
|
|
|
{% if ENABLE_ASAN == "y" %}
|
|
|
|
-a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" \
|
|
|
|
{% endif %}
|
2020-08-17 17:47:52 -05:00
|
|
|
-y /etc/sonic/constants.yml \
|
|
|
|
-t /usr/share/sonic/templates/switch.json.j2,/etc/swss/config.d/switch.json \
|
2022-01-31 07:57:30 -06:00
|
|
|
-t /usr/share/sonic/templates/vxlan.json.j2,/etc/swss/config.d/vxlan.json \
|
2020-08-17 17:47:52 -05:00
|
|
|
-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 \
|
2021-06-09 12:53:47 -05:00
|
|
|
-t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \
|
|
|
|
-t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf
|
2022-02-24 19:54:45 -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)
|
2017-02-02 22:34:34 -06:00
|
|
|
|
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
|
|
|
|
2020-11-22 23:18:44 -06:00
|
|
|
exec /usr/local/bin/supervisord
|