3
3
mkdir -p /etc/frr
4
4
mkdir -p /etc/supervisor/conf.d
5
5
6
- sonic-cfggen -d -t /usr/share/sonic/templates/supervisord/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
7
-
8
- CONFIG_TYPE=` sonic-cfggen -d -v ' DEVICE_METADATA["localhost"]["docker_routing_config_mode"]' `
6
+ CFGGEN_PARAMS=" \
7
+ -d \
8
+ -y /etc/sonic/constants.yml \
9
+ -t /usr/share/sonic/templates/supervisord/frr_vars.j2 \
10
+ -t /usr/share/sonic/templates/supervisord/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \
11
+ -t /usr/share/sonic/templates/bgpd/bgpd.conf.j2,/etc/frr/bgpd.conf \
12
+ -t /usr/share/sonic/templates/zebra/zebra.conf.j2,/etc/frr/zebra.conf \
13
+ -t /usr/share/sonic/templates/staticd/staticd.conf.j2,/etc/frr/staticd.conf \
14
+ -t /usr/share/sonic/templates/frr.conf.j2,/etc/frr/frr.conf \
15
+ -t /usr/share/sonic/templates/isolate.j2,/usr/sbin/bgp-isolate \
16
+ -t /usr/share/sonic/templates/unisolate.j2,/usr/sbin/bgp-unisolate \
17
+ "
18
+ CONFIG_TYPE=$( sonic-cfggen $CFGGEN_PARAMS )
9
19
10
20
if [[ ! -z " $NAMESPACE_ID " ]]; then
11
21
# FRR is not running in host namespace so we need to delete
@@ -31,24 +41,18 @@ if [[ ! -z "$NAMESPACE_ID" ]]; then
31
41
fi
32
42
33
43
if [ -z " $CONFIG_TYPE " ] || [ " $CONFIG_TYPE " == " separated" ]; then
34
- sonic-cfggen -d -t /usr/share/sonic/templates/bgpd/bgpd.conf.j2 -y /etc/sonic/constants.yml > /etc/frr/bgpd.conf
35
- sonic-cfggen -d -t /usr/share/sonic/templates/zebra/zebra.conf.j2 > /etc/frr/zebra.conf
36
- sonic-cfggen -d -t /usr/share/sonic/templates/staticd/staticd.conf.j2 > /etc/frr/staticd.conf
37
44
echo " no service integrated-vtysh-config" > /etc/frr/vtysh.conf
38
45
rm -f /etc/frr/frr.conf
39
46
elif [ " $CONFIG_TYPE " == " unified" ]; then
40
- sonic-cfggen -d -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/frr.conf.j2 > /etc/frr/frr.conf
41
47
echo " service integrated-vtysh-config" > /etc/frr/vtysh.conf
42
48
rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf
43
49
fi
44
50
45
51
chown -R frr:frr /etc/frr/
46
52
47
- sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate
48
53
chown root:root /usr/sbin/bgp-isolate
49
54
chmod 0755 /usr/sbin/bgp-isolate
50
55
51
- sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate
52
56
chown root:root /usr/sbin/bgp-unisolate
53
57
chmod 0755 /usr/sbin/bgp-unisolate
54
58
0 commit comments