Remove UpdateGraphService feature (#18330)
### Why I did it Remove UpdateGraphService feature from sonic image. The goal is to simplify the bootup process. ### How I did it Remove updategraph service and updategraph script. Update all related services, replace updategraph.service with config-setup.service. #### How to verify it Build and install new image, load minigraph and check all the services.
This commit is contained in:
parent
9da50901c4
commit
9a6d6137a3
@ -5,8 +5,6 @@
|
|||||||
#
|
#
|
||||||
# * PLATFORM: Specific platform we wish to build images for.
|
# * PLATFORM: Specific platform we wish to build images for.
|
||||||
# * BUILD_NUMBER: Desired version-number to pass to the building-system.
|
# * BUILD_NUMBER: Desired version-number to pass to the building-system.
|
||||||
# * ENABLE_DHCP_GRAPH_SERVICE: Enables get-graph service to fetch minigraph files
|
|
||||||
# through http.
|
|
||||||
# * ENABLE_ZTP: Enables zero touch provisioning.
|
# * ENABLE_ZTP: Enables zero touch provisioning.
|
||||||
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
|
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
|
||||||
# * INCLUDE_KUBERNETES: Allows including Kubernetes
|
# * INCLUDE_KUBERNETES: Allows including Kubernetes
|
||||||
@ -523,7 +521,6 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
|
|||||||
BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) \
|
BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) \
|
||||||
SONIC_IMAGE_VERSION=$(SONIC_IMAGE_VERSION) \
|
SONIC_IMAGE_VERSION=$(SONIC_IMAGE_VERSION) \
|
||||||
SLAVE_TAG=$(SLAVE_TAG) \
|
SLAVE_TAG=$(SLAVE_TAG) \
|
||||||
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
|
|
||||||
ENABLE_ZTP=$(ENABLE_ZTP) \
|
ENABLE_ZTP=$(ENABLE_ZTP) \
|
||||||
INCLUDE_PDE=$(INCLUDE_PDE) \
|
INCLUDE_PDE=$(INCLUDE_PDE) \
|
||||||
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
|
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=DHCP relay container
|
Description=DHCP relay container
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service swss.service syncd.service teamd.service
|
After=config-setup.service swss.service syncd.service teamd.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=EVENTD container
|
Description=EVENTD container
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
StartLimitIntervalSec=1200
|
StartLimitIntervalSec=1200
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=ICCPD container
|
Description=ICCPD container
|
||||||
Requires=updategraph.service swss.service
|
Requires=config-setup.service swss.service
|
||||||
After=updategraph.service swss.service
|
After=config-setup.service swss.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=MUX Cable Container
|
Description=MUX Cable Container
|
||||||
Requires=database.service updategraph.service swss.service
|
Requires=database.service config-setup.service swss.service
|
||||||
After=swss.service interfaces-config.service
|
After=swss.service interfaces-config.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=NAT container
|
Description=NAT container
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service swss.service syncd.service
|
After=config-setup.service swss.service syncd.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -5,7 +5,7 @@ Requires=opennsl-modules.service
|
|||||||
ConditionPathExists=!/usr/bin/swss.sh
|
ConditionPathExists=!/usr/bin/swss.sh
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
{% if sonic_asic_platform == 'broadcom' %}
|
{% if sonic_asic_platform == 'broadcom' %}
|
||||||
After=opennsl-modules.service
|
After=opennsl-modules.service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
Description=BGP container
|
Description=BGP container
|
||||||
Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
||||||
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description={{docker_container_name}} service
|
Description={{docker_container_name}} service
|
||||||
Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service updategraph.service
|
Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service config-setup.service
|
||||||
ConditionPathExists=!/usr/share/sonic/hwsku/gearbox_config.json
|
ConditionPathExists=!/usr/share/sonic/hwsku/gearbox_config.json
|
||||||
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service updategraph.service
|
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service config-setup.service
|
||||||
After=interfaces-config.service
|
After=interfaces-config.service
|
||||||
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
|
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
|
@ -4,8 +4,8 @@ Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
|||||||
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
After=database{% if multi_instance == 'true' %}@%i{% endif %}.service
|
||||||
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
|
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
|
||||||
After=syncd{% if multi_instance == 'true' %}@%i{% endif %}.service
|
After=syncd{% if multi_instance == 'true' %}@%i{% endif %}.service
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
|
@ -9,8 +9,8 @@ After=topology.service
|
|||||||
{% if sonic_asic_platform == 'broadcom' %}
|
{% if sonic_asic_platform == 'broadcom' %}
|
||||||
Requires=opennsl-modules.service
|
Requires=opennsl-modules.service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -14,8 +14,8 @@ After=opennsl-modules.service
|
|||||||
Requires=nps-modules.service
|
Requires=nps-modules.service
|
||||||
After=nps-modules.service
|
After=nps-modules.service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -5,8 +5,8 @@ After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
|
|||||||
Requires=topology.service
|
Requires=topology.service
|
||||||
After=topology.service
|
After=topology.service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Platform monitor container
|
Description=Platform monitor container
|
||||||
Requires=database.service updategraph.service
|
Requires=database.service config-setup.service
|
||||||
After=database.service updategraph.service
|
After=database.service config-setup.service
|
||||||
{% if sonic_asic_platform == 'mellanox' %}
|
{% if sonic_asic_platform == 'mellanox' %}
|
||||||
After=syncd.service
|
After=syncd.service
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Router advertiser container
|
Description=Router advertiser container
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service swss.service syncd.service
|
After=config-setup.service swss.service syncd.service
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=RestAPI container
|
Description=RestAPI container
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=SNMP container
|
Description=SNMP container
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
Requisite=swss.service
|
Requisite=swss.service
|
||||||
After=updategraph.service swss.service syncd.service interfaces-config.service
|
After=config-setup.service swss.service syncd.service interfaces-config.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp-config.service
|
Before=ntp-config.service
|
||||||
|
@ -610,18 +610,6 @@ sudo cp $IMAGE_CONFIGS/config-topology/config-topology.service $FILESYSTEM_ROOT_
|
|||||||
echo "config-topology.service" | sudo tee -a $GENERATED_SERVICE_FILE
|
echo "config-topology.service" | sudo tee -a $GENERATED_SERVICE_FILE
|
||||||
sudo cp $IMAGE_CONFIGS/config-topology/config-topology.sh $FILESYSTEM_ROOT/usr/bin
|
sudo cp $IMAGE_CONFIGS/config-topology/config-topology.sh $FILESYSTEM_ROOT/usr/bin
|
||||||
|
|
||||||
# Copy updategraph script and service file
|
|
||||||
j2 files/build_templates/updategraph.service.j2 | sudo tee $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/updategraph.service
|
|
||||||
sudo cp $IMAGE_CONFIGS/updategraph/updategraph $FILESYSTEM_ROOT/usr/bin/
|
|
||||||
echo "updategraph.service" | sudo tee -a $GENERATED_SERVICE_FILE
|
|
||||||
{% if enable_dhcp_graph_service == "y" %}
|
|
||||||
sudo bash -c "echo enabled=true > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
|
|
||||||
sudo bash -c "echo src=dhcp >> $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
|
|
||||||
sudo bash -c "echo dhcp_as_static=true >> $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
|
|
||||||
{% else %}
|
|
||||||
sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# Generate initial SONiC configuration file
|
# Generate initial SONiC configuration file
|
||||||
j2 files/build_templates/init_cfg.json.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/init_cfg.json
|
j2 files/build_templates/init_cfg.json.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/init_cfg.json
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=TACACS application
|
Description=TACACS application
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Delays tacacs apply until SONiC has started
|
Description=Delays tacacs apply until SONiC has started
|
||||||
PartOf=tacacs-config.service
|
PartOf=tacacs-config.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnUnitActiveSec=0 sec
|
OnUnitActiveSec=0 sec
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Update minigraph and set configuration based on minigraph
|
|
||||||
After=config-setup.service
|
|
||||||
Requires=config-setup.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/bin/updategraph
|
|
||||||
RemainAfterExit=yes
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -25,7 +25,6 @@
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
# Initialize constants
|
# Initialize constants
|
||||||
UPDATEGRAPH_CONF=/etc/sonic/updategraph.conf
|
|
||||||
INIT_CFG_JSON=/etc/sonic/init_cfg.json
|
INIT_CFG_JSON=/etc/sonic/init_cfg.json
|
||||||
CONFIG_DB_JSON=/etc/sonic/config_db.json
|
CONFIG_DB_JSON=/etc/sonic/config_db.json
|
||||||
CONFIG_DB_PATH=/etc/sonic/
|
CONFIG_DB_PATH=/etc/sonic/
|
||||||
@ -180,24 +179,6 @@ check_system_warm_boot()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if updategraph service is administratively enabled
|
|
||||||
updategraph_is_enabled()
|
|
||||||
{
|
|
||||||
rv=1
|
|
||||||
if [ -e ${UPDATEGRAPH_CONF} ]; then
|
|
||||||
updategraph_mode=$(grep enabled ${UPDATEGRAPH_CONF} | head -n 1 | cut -f2 -d=)
|
|
||||||
[ "${updategraph_mode}" = "true" ] && rv=0
|
|
||||||
fi
|
|
||||||
return $rv
|
|
||||||
}
|
|
||||||
|
|
||||||
# Disable updategraph admininistratively
|
|
||||||
disable_updategraph()
|
|
||||||
{
|
|
||||||
sed -i "/enabled=/d" ${UPDATEGRAPH_CONF}
|
|
||||||
echo "enabled=false" >> ${UPDATEGRAPH_CONF}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if Zero Touch Provisioning is available and is administratively enabled
|
# Check if Zero Touch Provisioning is available and is administratively enabled
|
||||||
ztp_is_enabled()
|
ztp_is_enabled()
|
||||||
{
|
{
|
||||||
@ -273,18 +254,14 @@ generate_config()
|
|||||||
|
|
||||||
# Create SONiC configuration for first time bootup
|
# Create SONiC configuration for first time bootup
|
||||||
# - If ZTP is enabled, ZTP configuraion is created
|
# - If ZTP is enabled, ZTP configuraion is created
|
||||||
# - If ZTP is disabled and updategraph is disabled, factory default configuration
|
# - If ZTP is disabled, factory default configuration
|
||||||
# is created
|
# is created
|
||||||
# - If updategraph is enabled and ZTP is disabled, updategraph initializes
|
|
||||||
# configuration
|
|
||||||
do_config_initialization()
|
do_config_initialization()
|
||||||
{
|
{
|
||||||
if ! updategraph_is_enabled ; then
|
if ! ztp_is_enabled ; then
|
||||||
if ! ztp_is_enabled ; then
|
echo "No configuration detected, generating factory default configuration..."
|
||||||
echo "No configuration detected, generating factory default configuration..."
|
generate_config factory ${CONFIG_DB_JSON}
|
||||||
generate_config factory ${CONFIG_DB_JSON}
|
reload_configdb ${CONFIG_DB_JSON}
|
||||||
reload_configdb ${CONFIG_DB_JSON}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ztp_is_enabled ; then
|
if ztp_is_enabled ; then
|
||||||
@ -376,7 +353,6 @@ do_config_migration()
|
|||||||
|
|
||||||
if [ x"${WARM_BOOT}" == x"true" ]; then
|
if [ x"${WARM_BOOT}" == x"true" ]; then
|
||||||
echo "Warm reboot detected..."
|
echo "Warm reboot detected..."
|
||||||
disable_updategraph
|
|
||||||
do_db_migration
|
do_db_migration
|
||||||
rm -f /tmp/pending_config_migration
|
rm -f /tmp/pending_config_migration
|
||||||
exit 0
|
exit 0
|
||||||
@ -384,14 +360,10 @@ do_config_migration()
|
|||||||
echo "Use config_db.json from old system..."
|
echo "Use config_db.json from old system..."
|
||||||
reload_configdb
|
reload_configdb
|
||||||
do_db_migration
|
do_db_migration
|
||||||
# Disable updategraph
|
|
||||||
disable_updategraph
|
|
||||||
elif [ -r ${MINGRAPH_FILE} ]; then
|
elif [ -r ${MINGRAPH_FILE} ]; then
|
||||||
echo "Use minigraph.xml from old system..."
|
echo "Use minigraph.xml from old system..."
|
||||||
reload_minigraph
|
reload_minigraph
|
||||||
do_db_migration
|
do_db_migration
|
||||||
# Disable updategraph
|
|
||||||
disable_updategraph
|
|
||||||
else
|
else
|
||||||
echo "Didn't found neither config_db.json nor minigraph.xml ..."
|
echo "Didn't found neither config_db.json nor minigraph.xml ..."
|
||||||
fi
|
fi
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update CoPP configuration
|
Description=Update CoPP configuration
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update hostname based on configdb
|
Description=Update hostname based on configdb
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update interfaces configuration
|
Description=Update interfaces configuration
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update logrotate configuration
|
Description=Update logrotate configuration
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update NTP configuration
|
Description=Update NTP configuration
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
Before=ntp.service
|
Before=ntp.service
|
||||||
|
@ -254,7 +254,7 @@ if [ -f $FIRST_BOOT_FILE ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to take old configuration saved during installation
|
# Try to take old configuration saved during installation
|
||||||
# and create a flag in /tmp/ to let updategraph service know
|
# and create a flag in /tmp/
|
||||||
if [ -d /host/old_config ]; then
|
if [ -d /host/old_config ]; then
|
||||||
mv -f /host/old_config /etc/sonic/
|
mv -f /host/old_config /etc/sonic/
|
||||||
rm -rf /etc/sonic/old_config/old_config
|
rm -rf /etc/sonic/old_config/old_config
|
||||||
@ -275,7 +275,6 @@ if [ -f $FIRST_BOOT_FILE ]; then
|
|||||||
[ -f /host/migration/snmp.yml ] && mv /host/migration/snmp.yml /etc/sonic/old_config/
|
[ -f /host/migration/snmp.yml ] && mv /host/migration/snmp.yml /etc/sonic/old_config/
|
||||||
[ -f /host/migration/golden_config_db.json ] && mv /host/migration/golden_config_db.json /etc/sonic/old_config/
|
[ -f /host/migration/golden_config_db.json ] && mv /host/migration/golden_config_db.json /etc/sonic/old_config/
|
||||||
touch /tmp/pending_config_migration
|
touch /tmp/pending_config_migration
|
||||||
[ -f /etc/sonic/updategraph.conf ] && sed -i -e "s/enabled=false/enabled=true/g" /etc/sonic/updategraph.conf
|
|
||||||
else
|
else
|
||||||
touch /tmp/pending_config_initialization
|
touch /tmp/pending_config_initialization
|
||||||
fi
|
fi
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update DNS configuration
|
Description=Update DNS configuration
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
StartLimitIntervalSec=0
|
StartLimitIntervalSec=0
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Update rsyslog configuration
|
Description=Update rsyslog configuration
|
||||||
Requires=updategraph.service
|
Requires=config-setup.service
|
||||||
After=updategraph.service
|
After=config-setup.service
|
||||||
BindsTo=sonic.target
|
BindsTo=sonic.target
|
||||||
After=sonic.target
|
After=sonic.target
|
||||||
After=interfaces-config.service
|
After=interfaces-config.service
|
||||||
|
@ -28,7 +28,6 @@ etc/sonic/old_config/.*
|
|||||||
etc/sonic/port_config.json
|
etc/sonic/port_config.json
|
||||||
etc/sonic/snmp.yml
|
etc/sonic/snmp.yml
|
||||||
etc/sonic/sonic-environment
|
etc/sonic/sonic-environment
|
||||||
etc/sonic/updategraph.conf
|
|
||||||
etc/ssh/ssh_host_rsa_key.pub
|
etc/ssh/ssh_host_rsa_key.pub
|
||||||
etc/ssh/ssh_host_rsa_key
|
etc/ssh/ssh_host_rsa_key
|
||||||
etc/subgid
|
etc/subgid
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=SONiC system health monitor
|
Description=SONiC system health monitor
|
||||||
Requires=database.service updategraph.service
|
Requires=database.service config-setup.service
|
||||||
After=database.service updategraph.service
|
After=database.service config-setup.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/healthd
|
ExecStart=/usr/local/bin/healthd
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# read SONiC immutable variables
|
|
||||||
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
|
|
||||||
|
|
||||||
if [ ! -f /etc/sonic/updategraph.conf ]; then
|
|
||||||
echo "No updategraph.conf found, generating a default one."
|
|
||||||
echo "enabled=false" >/etc/sonic/updategraph.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /etc/sonic/updategraph.conf
|
|
||||||
|
|
||||||
if [ "$enabled" = "reload_only" ]; then
|
|
||||||
echo "reload_only will not be supported in file updategraph.conf"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$enabled" != "true" ]; then
|
|
||||||
echo "Disabled in updategraph.conf. Skipping graph update."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If ZTP package is available and enabled, use ZTP to download and load the graph.
|
|
||||||
if [ -e /usr/bin/ztp ] && [ "$(ztp status -c)" != "0:DISABLED" ]; then
|
|
||||||
echo "ZTP is available and enabled. Skipping graph update."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# "`cat /tmp/dhcp_graph_url`" is always "N/A"
|
|
||||||
echo "No graph_url option in DHCP response. Skipping graph update and generating an empty configuration."
|
|
||||||
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
|
|
||||||
if [ -f /etc/sonic/minigraph.xml ]; then
|
|
||||||
sonic-cfggen -H -m /etc/sonic/minigraph.xml --preset empty > /tmp/device_meta.json
|
|
||||||
else
|
|
||||||
PRESET=(`head -n 1 /usr/share/sonic/device/$PLATFORM/default_sku`)
|
|
||||||
sonic-cfggen -H -k ${PRESET[0]} --preset empty > /tmp/device_meta.json
|
|
||||||
fi
|
|
||||||
if [ -f /etc/sonic/init_cfg.json ]; then
|
|
||||||
sonic-cfggen -j /tmp/device_meta.json -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
|
|
||||||
else
|
|
||||||
cp -f /tmp/device_meta.json /etc/sonic/config_db.json
|
|
||||||
fi
|
|
||||||
sonic-db-cli CONFIG_DB FLUSHDB
|
|
||||||
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db
|
|
||||||
sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1"
|
|
||||||
if [ "$dhcp_as_static" = "true" ]; then
|
|
||||||
sed -i "/enabled=/d" /etc/sonic/updategraph.conf
|
|
||||||
echo "enabled=false" >> /etc/sonic/updategraph.conf
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
|
|
@ -48,12 +48,6 @@ DEFAULT_USERNAME = admin
|
|||||||
# DEFAULT_PASSWORD - default password for installer build
|
# DEFAULT_PASSWORD - default password for installer build
|
||||||
DEFAULT_PASSWORD = YourPaSsWoRd
|
DEFAULT_PASSWORD = YourPaSsWoRd
|
||||||
|
|
||||||
# ENABLE_DHCP_GRAPH_SERVICE - specify the source of minigraph to generate configuration file.
|
|
||||||
# If set to y SONiC will get the minigraph from graph service. Graph service URL need to be
|
|
||||||
# passed through DHCP option 225.
|
|
||||||
# If not set (default behavior) the default minigraph built into the image will be used.
|
|
||||||
# ENABLE_DHCP_GRAPH_SERVICE = y
|
|
||||||
|
|
||||||
# ENABLE_ZTP - installs Zero Touch Provisioning support.
|
# ENABLE_ZTP - installs Zero Touch Provisioning support.
|
||||||
# ENABLE_ZTP = y
|
# ENABLE_ZTP = y
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ $(DOCKER_DHCP_RELAY)_VERSION = 1.0.0
|
|||||||
$(DOCKER_DHCP_RELAY)_PACKAGE_NAME = dhcp-relay
|
$(DOCKER_DHCP_RELAY)_PACKAGE_NAME = dhcp-relay
|
||||||
$(DOCKER_DHCP_RELAY)_PACKAGE_DEPENDS = database^1.0.0
|
$(DOCKER_DHCP_RELAY)_PACKAGE_DEPENDS = database^1.0.0
|
||||||
|
|
||||||
$(DOCKER_DHCP_RELAY)_SERVICE_REQUIRES = updategraph
|
$(DOCKER_DHCP_RELAY)_SERVICE_REQUIRES = config-setup
|
||||||
$(DOCKER_DHCP_RELAY)_SERVICE_AFTER = swss syncd teamd
|
$(DOCKER_DHCP_RELAY)_SERVICE_AFTER = swss syncd teamd
|
||||||
$(DOCKER_DHCP_RELAY)_SERVICE_BEFORE = ntp-config
|
$(DOCKER_DHCP_RELAY)_SERVICE_BEFORE = ntp-config
|
||||||
$(DOCKER_DHCP_RELAY)_SERVICE_DEPENDENT_OF = swss
|
$(DOCKER_DHCP_RELAY)_SERVICE_DEPENDENT_OF = swss
|
||||||
|
@ -38,7 +38,7 @@ $(DOCKER_DHCP_SERVER)_CONTAINER_NAME = dhcp_server
|
|||||||
$(DOCKER_DHCP_SERVER)_VERSION = 1.0.0
|
$(DOCKER_DHCP_SERVER)_VERSION = 1.0.0
|
||||||
$(DOCKER_DHCP_SERVER)_PACKAGE_NAME = dhcp-server
|
$(DOCKER_DHCP_SERVER)_PACKAGE_NAME = dhcp-server
|
||||||
|
|
||||||
$(DOCKER_MACSEC)_SERVICE_REQUIRES = updategraph
|
$(DOCKER_MACSEC)_SERVICE_REQUIRES = config-setup
|
||||||
$(DOCKER_MACSEC)_SERVICE_AFTER = swss syncd
|
$(DOCKER_MACSEC)_SERVICE_AFTER = swss syncd
|
||||||
|
|
||||||
$(DOCKER_DHCP_SERVER)_CONTAINER_PRIVILEGED = false
|
$(DOCKER_DHCP_SERVER)_CONTAINER_PRIVILEGED = false
|
||||||
|
@ -21,9 +21,6 @@ $(DOCKER_EVENTD)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON)
|
|||||||
$(DOCKER_EVENTD)_VERSION = 1.0.0
|
$(DOCKER_EVENTD)_VERSION = 1.0.0
|
||||||
$(DOCKER_EVENTD)_PACKAGE_NAME = eventd
|
$(DOCKER_EVENTD)_PACKAGE_NAME = eventd
|
||||||
|
|
||||||
$(DOCKER_DHCP)_SERVICE_REQUIRES = updategraph
|
|
||||||
$(DOCKER_DHCP)_SERVICE_AFTER = database
|
|
||||||
|
|
||||||
SONIC_DOCKER_IMAGES += $(DOCKER_EVENTD)
|
SONIC_DOCKER_IMAGES += $(DOCKER_EVENTD)
|
||||||
ifeq ($(INCLUDE_SYSTEM_EVENTD), y)
|
ifeq ($(INCLUDE_SYSTEM_EVENTD), y)
|
||||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_EVENTD)
|
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_EVENTD)
|
||||||
|
@ -44,7 +44,7 @@ $(DOCKER_MACSEC)_CONTAINER_VOLUMES += /etc/sonic:/etc/sonic:ro
|
|||||||
$(DOCKER_MACSEC)_CONTAINER_VOLUMES += /etc/timezone:/etc/timezone:ro
|
$(DOCKER_MACSEC)_CONTAINER_VOLUMES += /etc/timezone:/etc/timezone:ro
|
||||||
$(DOCKER_MACSEC)_CONTAINER_VOLUMES += /host/warmboot:/var/warmboot
|
$(DOCKER_MACSEC)_CONTAINER_VOLUMES += /host/warmboot:/var/warmboot
|
||||||
|
|
||||||
$(DOCKER_MACSEC)_SERVICE_REQUIRES = updategraph
|
$(DOCKER_MACSEC)_SERVICE_REQUIRES = config-setup
|
||||||
$(DOCKER_MACSEC)_SERVICE_AFTER = swss syncd
|
$(DOCKER_MACSEC)_SERVICE_AFTER = swss syncd
|
||||||
|
|
||||||
$(DOCKER_MACSEC)_CLI_CONFIG_PLUGIN = /cli/config/plugins/macsec.py
|
$(DOCKER_MACSEC)_CLI_CONFIG_PLUGIN = /cli/config/plugins/macsec.py
|
||||||
|
2
slave.mk
2
slave.mk
@ -397,7 +397,6 @@ $(info "SECURE_UPGRADE_SIGNING_CERT" : "$(SECURE_UPGRADE_SIGNING_CERT)")
|
|||||||
$(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)")
|
$(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)")
|
||||||
$(info "SECURE_UPGRADE_PROD_TOOL_ARGS" : "$(SECURE_UPGRADE_PROD_TOOL_ARGS)")
|
$(info "SECURE_UPGRADE_PROD_TOOL_ARGS" : "$(SECURE_UPGRADE_PROD_TOOL_ARGS)")
|
||||||
$(info "ONIE_IMAGE_PART_SIZE" : "$(ONIE_IMAGE_PART_SIZE)")
|
$(info "ONIE_IMAGE_PART_SIZE" : "$(ONIE_IMAGE_PART_SIZE)")
|
||||||
$(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)")
|
|
||||||
$(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)")
|
$(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)")
|
||||||
$(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)")
|
$(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)")
|
||||||
$(info "SONIC_BUFFER_MODEL" : "$(SONIC_BUFFER_MODEL)")
|
$(info "SONIC_BUFFER_MODEL" : "$(SONIC_BUFFER_MODEL)")
|
||||||
@ -1412,7 +1411,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
|
|||||||
export sonicadmin_user="$(USERNAME)"
|
export sonicadmin_user="$(USERNAME)"
|
||||||
export sonic_asic_platform="$(patsubst %-$(CONFIGURED_ARCH),%,$(CONFIGURED_PLATFORM))"
|
export sonic_asic_platform="$(patsubst %-$(CONFIGURED_ARCH),%,$(CONFIGURED_PLATFORM))"
|
||||||
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
|
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
|
||||||
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
|
|
||||||
export enable_ztp="$(ENABLE_ZTP)"
|
export enable_ztp="$(ENABLE_ZTP)"
|
||||||
export include_teamd="$(INCLUDE_TEAMD)"
|
export include_teamd="$(INCLUDE_TEAMD)"
|
||||||
export include_router_advertiser="$(INCLUDE_ROUTER_ADVERTISER)"
|
export include_router_advertiser="$(INCLUDE_ROUTER_ADVERTISER)"
|
||||||
|
Loading…
Reference in New Issue
Block a user