Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
504c632
[files]: add namespace synchronization target
Jul 17, 2019
8571864
[database docker]: add multi-instance support
Jul 11, 2019
2245ffe
[files]: add swss multi-instance support
Jun 13, 2019
193f182
[files]: add multi-instance support for syncd
Jul 17, 2019
aa44fda
[files]: add multi-instance support to logging
Jun 17, 2019
f4844e8
[files]: add namespace wrapper
Jun 18, 2019
a13a8d8
[platform/vs]: add memory to virtual switch
Jul 17, 2019
f99839b
[build_templates]: add multi-namespace spport to bgp
Jun 20, 2019
9328339
[build_templates]: add multi-instance support to teamd
Jun 20, 2019
04b4887
[sonic-utilities]: update sonic-utilities
Jun 26, 2019
f3c48d6
[interfaces-config]: enable multi-asic support
Jun 26, 2019
d5c4a0d
[files]: change namespace name
Aug 2, 2019
83ca4de
Remove namespace docker related files.
SuvarnaMeenakshi Dec 12, 2019
6e3b519
[build_templates]: remove namespace service dependency
SuvarnaMeenakshi Jan 15, 2020
87220d9
Merge remote-tracking branch 'remotes/origin/master' into sumeenak_pr_2
SuvarnaMeenakshi Feb 12, 2020
81b024e
[redis-cli/sonic-cfggen]: Add wrappers to talk to database instance in
SuvarnaMeenakshi Feb 12, 2020
1875e6b
[swss.sh]: Modified to use redis-cli wrapper to talk to multiple
SuvarnaMeenakshi Feb 12, 2020
3363c0d
[syncd.sh]: Updated to use redis-cli wrapper to talk to multiple
SuvarnaMeenakshi Feb 12, 2020
95fb5f5
[docker_img_ctl.j2]: Updated to use redis-cli/sonic-cfggen wrappers
SuvarnaMeenakshi Feb 12, 2020
382f13e
[database service]: changes made to include global database service
SuvarnaMeenakshi Feb 12, 2020
c20bf43
[swss/syncd services]: Added dependency to topology.service for VS
SuvarnaMeenakshi Feb 12, 2020
a76eb01
[interfaces-config.sh]: Made changes to support multi-asic platform
SuvarnaMeenakshi Feb 12, 2020
d7ab64b
[topology.sh]: Updated to read Platform and SKU information from
SuvarnaMeenakshi Feb 12, 2020
61971a7
[namespace.sh]: Remove namespace.sh as namespace docker is not used
SuvarnaMeenakshi Feb 12, 2020
81a8f74
LLDP Multi-Asic Support.
abdosi Feb 20, 2020
4beb4ad
[sonic-cfggen wrapper]: Change mode to make the script executable.
SuvarnaMeenakshi Feb 21, 2020
4ce974d
Merge remote-tracking branch 'remotes/sumeenak/master' into pr_2_mult…
SuvarnaMeenakshi Feb 21, 2020
d754022
Merge branch 'pr_2_multiasic' of github.com:SuvarnaMeenakshi/sonic-bu…
SuvarnaMeenakshi Feb 21, 2020
f935036
[sonic-db-cli wrapper]: Add a new wrapper script to accept a
SuvarnaMeenakshi Feb 22, 2020
0dae0d8
[msft_multi_asic_vs]: Add lanemap.ini and sai.profile to support
SuvarnaMeenakshi Feb 22, 2020
173ba4e
[syncd.sh/swss.sh]: Modify script to use sonic-db-cli wrapper.
SuvarnaMeenakshi Feb 22, 2020
3a8a68c
[docker_image_ctl.j2]: Minor fix
SuvarnaMeenakshi Feb 22, 2020
f2d02bc
Modified creation of multi-asic frr directories from
SuvarnaMeenakshi Feb 24, 2020
d252a19
[sonic_multiasic.xml]: Increased the number of vcpus to support
SuvarnaMeenakshi Feb 24, 2020
5ba42df
[sonic_debian_extension]: Add config-setup.service in
SuvarnaMeenakshi Feb 25, 2020
97d2643
[sonic-netns-exec]: Added a new wrapper to execute any command in
SuvarnaMeenakshi Feb 26, 2020
01e9304
Merge remote-tracking branch 'remotes/sumeenak/master' into pr2multiasic
SuvarnaMeenakshi Feb 26, 2020
d83392a
[rsyslog-service]: Remove multiple instance systemd service templates
SuvarnaMeenakshi Feb 26, 2020
9dddcff
[interfaces-config.sh]: Updated script to use sonic-db-cli to
SuvarnaMeenakshi Feb 26, 2020
e2a9e6c
[sonic-netns-exec]: Modified to accept network namespace string
SuvarnaMeenakshi Feb 28, 2020
5f8ffe6
Minor correction to pass the right parameter to sonic-netns-exec
SuvarnaMeenakshi Feb 28, 2020
bf7b0c4
[redis-cli]: Reverting changes added to redis-cli to execute in
SuvarnaMeenakshi Feb 28, 2020
42a3572
Review comments fix
SuvarnaMeenakshi Mar 5, 2020
91af223
[topology.sh]: Fix indentation
SuvarnaMeenakshi Mar 6, 2020
0e6033a
[interfaces-config]: remove multiple instances of interfaces-config@
SuvarnaMeenakshi Mar 9, 2020
fe3ba83
[build_templates]: Combined single and multi instance service template
SuvarnaMeenakshi Mar 10, 2020
f4d5d49
[slave.mk]: Fix indendation
SuvarnaMeenakshi Mar 10, 2020
c2ce0b6
[docker_image_ctl]: Fix as per review comment. Use ip netns pid
SuvarnaMeenakshi Mar 10, 2020
ab45a88
Merge remote-tracking branch 'remotes/sumeenak/master' into pr2multiasic
SuvarnaMeenakshi Mar 10, 2020
34f9213
[docker_img_ctl.j2]: Minor fix after resolving merge conflicts.
SuvarnaMeenakshi Mar 10, 2020
cdb2fb3
[database.service]: Rename service template file to ensure that
SuvarnaMeenakshi Mar 11, 2020
0594d1a
[docker_img_ctl.j2]: Fix to use same init_cfg for all instances.
SuvarnaMeenakshi Mar 11, 2020
45c0e73
[build_templates]: Change directory as per review comment.
SuvarnaMeenakshi Mar 12, 2020
b4d2071
[docker_image_ctl]: Modify directory structure of frr directory
SuvarnaMeenakshi Mar 12, 2020
030be0b
[docker_image_ctl.j2]: Change command used to check if a namespace
SuvarnaMeenakshi Mar 12, 2020
42c6db3
[docker_image_ctl]: Minor fix to add comment
SuvarnaMeenakshi Mar 12, 2020
32c56c3
[database.globalservice]: Remove incorrect file. This file is no
SuvarnaMeenakshi Mar 12, 2020
6c8e56f
[build_templates]: Modified service template file to make them
SuvarnaMeenakshi Mar 13, 2020
27ea754
[build_templates]: Modified templates as per review comments.
SuvarnaMeenakshi Mar 14, 2020
b4b557e
Minor indendation fix.
SuvarnaMeenakshi Mar 14, 2020
4d1204d
[build_templates]: Minor update in per namespace service templates
SuvarnaMeenakshi Mar 18, 2020
fa25e1a
[syncd.servic]: Minor update in template file to make it concise.
SuvarnaMeenakshi Mar 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions dockers/docker-database/base_image_files/redis-cli
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

DOCKER_EXEC_FLAGS="i"

# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
NS="asic" #Network namespace
[ "$1" -eq "$1" ] 2> /dev/null # check if the first argument is a number
# if it's a number, set the database instance to
#operate on that instance
if [ $? -eq 0 ]; then
DEV="$1"
shift
fi
if [ -z "$DEV" ]; then
sonic-db-cli "$@"
else
ip netns exec $NS$DEV sonic-db-cli "$@"
fi

docker exec -$DOCKER_EXEC_FLAGS database redis-cli "$@"
20 changes: 20 additions & 0 deletions dockers/docker-fpm-frr/bgpd.conf.default.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ route-map TO_BGP_PEER_V4 permit 100
!
route-map TO_BGP_PEER_V6 permit 100
!
{% if DEVICE_METADATA['localhost']['type'] == 'InternalFrontend' %}
route-map HIDE_INTERNAL permit 10
set community local-AS
!
{% endif %}
{% if DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
route-map OVERRIDE_ORIGINATOR_ID permit 10
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
{% if prefix | ipv4 and name == 'Loopback0' %}
set originator-id {{ prefix | ip }}
{% endif %}
{% endfor %}
!
{% endif %}
{% if BGP_MONITORS is defined and BGP_MONITORS|length > 0 %}
route-map FROM_BGPMON deny 10
!
Expand All @@ -37,6 +51,9 @@ route-map set-next-hop-global-v6 permit 10
set ipv6 next-hop prefer-global
!
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
{% if DEVICE_METADATA['localhost']['type'] == 'InternalFrontend' %}
redistribute connected route-map HIDE_INTERNAL
{% endif %}
bgp log-neighbor-changes
bgp bestpath as-path multipath-relax
no bgp default ipv4-unicast
Expand Down Expand Up @@ -151,6 +168,9 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
neighbor {{ neighbor_addr }} peer-group BGPMON
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }}
neighbor {{ neighbor_addr }} activate
{% if DEVICE_METADATA['localhost']['type'] == 'InternalBackend' %}
neighbor {{ neighbor_addr }} route-map OVERRIDE_ORIGINATOR_ID in
{% endif %}
address-family ipv6
neighbor {{ neighbor_addr }} activate
exit-address-family
Expand Down
54 changes: 32 additions & 22 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ link_namespace() {
mkdir -p /var/run/netns
PID="$(docker inspect -f {{"'{{.State.Pid}}'"}} "{{docker_container_name}}$DEV")"

if `ip netns | grep --quiet -w "{{docker_container_name}}$DEV"`; then # namespace exists
if `ip netns | grep --quiet -w "$NET_NS$DEV"`; then # namespace exists
if [ $(readlink -f /var/run/netns/$NET_NS$DEV) = $(readlink -f /proc/$PID/ns/net) ]; then # namespace is correctly linked
return 0
else # if it's incorrectly linked remove it
ip netns delete "{{docker_container_name}}$DEV"
ip netns delete $NET_NS$DEV
fi
fi

Expand Down Expand Up @@ -82,14 +82,14 @@ function preStartAction()
WARM_DIR=/host/warmboot
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then
# Load redis content from /host/warmboot/dump.rdb
docker cp $WARM_DIR/dump.rdb database:/var/lib/redis/dump.rdb
docker cp $WARM_DIR/dump.rdb database$DEV:/var/lib/redis/dump.rdb
else
# Create an emtpy file and overwrite any RDB if already there
echo -n > /tmp/dump.rdb
docker cp /tmp/dump.rdb database:/var/lib/redis/
docker cp /tmp/dump.rdb database$DEV:/var/lib/redis/
fi
{%- elif docker_container_name == "snmp" %}
sonic-db-cli STATE_DB HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s)
/usr/bin/redis-cli $DEV STATE_DB HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s)
{%- else %}
: # nothing
{%- endif %}
Expand All @@ -102,36 +102,43 @@ function postStartAction()
link_namespace $DEV
fi
# Wait until redis starts
/usr/bin/docker exec database ping_pong_db_insts
/usr/bin/docker exec database$DEV ping_pong_db_insts
REDIS_SOCK="/var/run/redis/redis.sock"
EXT_REDIS_SOCK="/var/run/redis$DEV/redis.sock" # location of redis socket in the base image
if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then
rm -f $WARM_DIR/dump.rdb
else
# If there is a config db dump file, load it
if [ -r /etc/sonic/config_db.json ]; then
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
if [ -r /etc/sonic/config_db$DEV.json ]; then
/usr/bin/sonic-cfggen $DEV -j /etc/sonic/config_db$DEV.json --write-to-db
fi

if [[ "$BOOT_TYPE" == "fast" ]]; then
# set the key to expire in 3 minutes
sonic-db-cli STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180"
/usr/bin/redis-cli $DEV STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180"
fi

sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
/usr/bin/redis-cli $DEV CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
fi

if [[ -x /usr/bin/db_migrator.py ]]; then
# Migrate the DB to the latest schema version if needed
/usr/bin/db_migrator.py -o migrate
/usr/bin/db_migrator.py -o migrate -s $EXT_REDIS_SOCK

# Save in memory config_db to config_db.json for 2 reasons:
# 1. Persist the DB migration result.
# 2. Save in memory DB after warm reboot.
/usr/bin/config save -y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it play out with config-setup?

config-setup.service is starting after database.service. When a switch boots for the first time the initial configuration will be generated by config-setup and loaded into the DB. With this change, an empty initial configuration will be created before config-setup has a chance to generate a proper config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this line. We should not be doing config save here.

fi
{%- elif docker_container_name == "swss" %}
docker exec swss rm -f /ready # remove cruft
docker exec swss$DEV rm -f /ready # remove cruft
if [[ "$BOOT_TYPE" == "fast" ]] && [[ -d /host/fast-reboot ]]; then
test -e /host/fast-reboot/fdb.json && docker cp /host/fast-reboot/fdb.json swss:/
test -e /host/fast-reboot/arp.json && docker cp /host/fast-reboot/arp.json swss:/
test -e /host/fast-reboot/default_routes.json && docker cp /host/fast-reboot/default_routes.json swss:/
test -e /host/fast-reboot/fdb.json && docker cp /host/fast-reboot/fdb.json swss$DEV:/
test -e /host/fast-reboot/arp.json && docker cp /host/fast-reboot/arp.json swss$DEV:/
test -e /host/fast-reboot/default_routes.json && docker cp /host/fast-reboot/default_routes.json swss$DEV:/
rm -fr /host/fast-reboot
fi
docker exec swss touch /ready # signal swssconfig.sh to go
docker exec swss$DEV touch /ready # signal swssconfig.sh to go
{%- elif docker_container_name == "pmon" %}

DEVPATH="/usr/share/sonic/device"
Expand All @@ -153,15 +160,15 @@ start() {
BOOT_TYPE=`getBootType`

# Obtain our platform as we will mount directories with these names in each docker
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
PLATFORM=`/usr/bin/sonic-cfggen $DEV -H -v DEVICE_METADATA.localhost.platform`

{%- if docker_container_name == "database" %}
# Don't mount HWSKU in {{docker_container_name}} container.
HWSKU=""
{%- else %}
# Obtain our HWSKU as we will mount directories with these names in each docker
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
HOSTNAME=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hostname"]'`
HWSKU=`/usr/bin/sonic-cfggen $DEV -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`
HOSTNAME=`/usr/bin/sonic-cfggen $DEV -d -v 'DEVICE_METADATA["localhost"]["hostname"]'`
{%- endif %}
if [ -z "$HOSTNAME" ] || ! [[ $HOSTNAME =~ ^[a-zA-Z0-9.\-]*$ ]]; then
HOSTNAME=`hostname`
Expand Down Expand Up @@ -241,10 +248,13 @@ start() {
--tmpfs /tmp \
{%- endif %}
{%- endif %}
-v /var/run/redis:/var/run/redis:rw \
{%- if docker_container_name == "bgp" %}
-v /etc/sonic/frr$DEV:/etc/frr:rw \
{%- endif %}
-v /var/run/redis$DEV:/var/run/redis:rw \
-v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \
{%- if docker_container_name != "database" %}
-v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \
-v /usr/share/sonic/device/$PLATFORM/$HWSKU/$DEV:/usr/share/sonic/hwsku:ro \
{%- endif %}
{%- if sonic_asic_platform != "mellanox" %}
--tmpfs /tmp \
Expand All @@ -256,7 +266,7 @@ start() {
}

preStartAction
docker start {{docker_container_name}}
docker start {{docker_container_name}}$DEV
postStartAction
updateHostName "$HOSTNAME"
}
Expand Down
16 changes: 16 additions & 0 deletions files/build_templates/multi_instance/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=BGP container
#Requires=updategraph.service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuvarnaMeenakshi @lguohan : we don't need this dependency for Multi Instance ? Single Instance still have this dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support for updategraph and config-setup service for multi-asic platform will be added in a separate PR. As updategraph service is not updated to support multiple config_db, this dependency cannot be added here.

#After=updategraph.service
After=database@%i.service
Requires=database@%i.service
Before=ntp-config.service

[Service]
User=root
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start %i
ExecStart=/usr/bin/{{docker_container_name}}.sh wait %i
ExecStop=/usr/bin/{{docker_container_name}}.sh stop %i

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions files/build_templates/multi_instance/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Database container
Requires=docker.service database.service
After=docker.service database.service

[Service]
User=root
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start %i
ExecStart=/usr/bin/{{docker_container_name}}.sh wait %i
ExecStop=/usr/bin/{{docker_container_name}}.sh stop %i
Restart=on-failure
TimeoutStartSec=120

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions files/build_templates/multi_instance/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=LLDP container
#Requires=updategraph.service
#After=updategraph.service
After=database@%i.service
Requires=database@%i.service
Before=ntp-config.service

[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start %i
ExecStart=/usr/bin/{{docker_container_name}}.sh wait %i
ExecStop=/usr/bin/{{docker_container_name}}.sh stop %i

[Install]
WantedBy=multi-user.target
32 changes: 32 additions & 0 deletions files/build_templates/multi_instance/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[Unit]
Description=switch state service
Requires=database@%i.service
#updategraph.service
{% if sonic_asic_platform == 'broadcom' %}
Requires=opennsl-modules.service
{% elif sonic_asic_platform == 'nephos' %}
Requires=nps-modules-4.9.0-9-2-amd64.service
{% elif sonic_asic_platform == 'vs' %}
Requires=topology.service
{% endif %}
After=database@%i.service
{% if sonic_asic_platform == 'vs' %}
After=topology.service
{% endif %}
#updategraph.service
After=interfaces-config@%i.service
Before=ntp-config.service
StartLimitIntervalSec=1200
StartLimitBurst=3

[Service]
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
ExecStartPre=/usr/local/bin/swss.sh start %i
ExecStart=/usr/local/bin/swss.sh wait %i
ExecStop=/usr/local/bin/swss.sh stop %i
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
36 changes: 36 additions & 0 deletions files/build_templates/multi_instance/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[Unit]
Description=syncd service
Requires=database@%i.service
#updategraph.service
{% if sonic_asic_platform == 'broadcom' %}
Requires=opennsl-modules.service
{% elif sonic_asic_platform == 'nephos' %}
Requires=nps-modules-4.9.0-8-2-amd64.service
{% elif sonic_asic_platform == 'vs' %}
Requires=topology.service
{% endif %}
After=database@%i.service
#updategraph.service
After=interfaces-config.service
{% if sonic_asic_platform == 'broadcom' %}
After=opennsl-modules.service
{% elif sonic_asic_platform == 'nephos' %}
After=nps-modules-4.9.0-8-2-amd64.service
{% elif sonic_asic_platform == 'vs' %}
After=topology.service
{% endif %}
After=swss@%i.service
Before=ntp-config.service

[Service]
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
ExecStartPre=/usr/local/bin/syncd.sh start %i
ExecStart=/usr/local/bin/syncd.sh wait %i
ExecStop=/usr/local/bin/syncd.sh stop %i
{% if sonic_asic_platform == 'mellanox' %}
TimeoutStartSec=150
{% endif %}

[Install]
WantedBy=multi-user.target
17 changes: 17 additions & 0 deletions files/build_templates/multi_instance/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=TEAMD container
#Requires=updategraph.service
Requires=swss@%i.service
#After=updategraph.service
After=swss@%i.service
Before=ntp-config.service

[Service]
User=root
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start %i
ExecStart=/usr/bin/{{docker_container_name}}.sh wait %i
ExecStop=/usr/bin/{{docker_container_name}}.sh stop %i

[Install]
WantedBy=swss@%i.service
RequiredBy=multi-user.target
15 changes: 15 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,14 @@ echo "warmboot-finalizer.service" | sudo tee -a $GENERATED_SERVICE_FILE

# Copy rsyslog configuration files and templates
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo cp $IMAGE_CONFIGS/rsyslog/[email protected] $FILESYSTEM_ROOT/etc/systemd/system/
sudo cp $IMAGE_CONFIGS/rsyslog/[email protected] $FILESYSTEM_ROOT/etc/systemd/system
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.sh $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/* $FILESYSTEM_ROOT/etc/rsyslog.d/
echo "rsyslog-config.service" | sudo tee -a $GENERATED_SERVICE_FILE
echo "[email protected]" | sudo tee -a $GENERATED_SERVICE_FILE
echo "[email protected]" | sudo tee -a $GENERATED_SERVICE_FILE

# Copy logrotate.d configuration files
sudo cp -f $IMAGE_CONFIGS/logrotate/logrotate.d/* $FILESYSTEM_ROOT/etc/logrotate.d/
Expand All @@ -214,9 +218,11 @@ sudo cp -f $IMAGE_CONFIGS/logrotate/logrotate.d/* $FILESYSTEM_ROOT/etc/logrotate
sudo cp -f $IMAGE_CONFIGS/systemd/journald.conf $FILESYSTEM_ROOT/etc/systemd/

# Copy interfaces configuration files and templates
sudo cp $IMAGE_CONFIGS/interfaces/[email protected] $FILESYSTEM_ROOT/etc/systemd/system/
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.sh $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
echo "[email protected]" | sudo tee -a $GENERATED_SERVICE_FILE
echo "interfaces-config.service" | sudo tee -a $GENERATED_SERVICE_FILE

# Copy dhcp client configuration template and create an initial configuration
Expand Down Expand Up @@ -429,6 +435,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT umount -lf /sys
# Copy swss and syncd service script
sudo LANG=C cp $SCRIPTS_DIR/swss.sh $FILESYSTEM_ROOT/usr/local/bin/swss.sh
sudo LANG=C cp $SCRIPTS_DIR/syncd.sh $FILESYSTEM_ROOT/usr/local/bin/syncd.sh
sudo LANG=C cp $SCRIPTS_DIR/sonic-cfggen $FILESYSTEM_ROOT/usr/bin/sonic-cfggen

# Copy systemd timer configuration
# It implements delayed start of services
Expand Down Expand Up @@ -469,6 +476,14 @@ sudo rm -rf $FILESYSTEM_ROOT/$MLNX_PLATFORM_COMMON_PY2_WHEEL_NAME
{% endif %}

{%- if SONIC_ROUTING_STACK == "frr" %}
{% for i in range(6) %}
sudo mkdir $FILESYSTEM_ROOT/etc/sonic/frr{{i}}
sudo touch $FILESYSTEM_ROOT/etc/sonic/frr{{i}}/frr.conf
sudo touch $FILESYSTEM_ROOT/etc/sonic/frr{{i}}/vtysh.conf
sudo chown -R $FRR_USER_UID:$FRR_USER_GID $FILESYSTEM_ROOT/etc/sonic/frr{{i}}
sudo chmod -R 640 $FILESYSTEM_ROOT/etc/sonic/frr{{i}}/
sudo chmod 750 $FILESYSTEM_ROOT/etc/sonic/frr{{i}}
{%- endfor %}
sudo mkdir $FILESYSTEM_ROOT/etc/sonic/frr
sudo touch $FILESYSTEM_ROOT/etc/sonic/frr/frr.conf
sudo touch $FILESYSTEM_ROOT/etc/sonic/frr/vtysh.conf
Expand Down
2 changes: 1 addition & 1 deletion files/image_config/interfaces/interfaces-config.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Type=oneshot
ExecStart=/usr/bin/interfaces-config.sh

[Install]
WantedBy=multi-user.target
RequiredBy=multi-user.target
Loading