Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion files/Aboot/boot0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ clean_flash() {
[ $f != "old_config" ] &&
[ $f != "minigraph.xml" ] &&
[ $f != "snmp.yml" ] &&
[ $f != "acl.json" ]
[ $f != "acl.json" ] &&
[ $f != "port_config.json" ]
then
rm -rf "$target_path/$f"
fi
Expand Down
2 changes: 1 addition & 1 deletion files/image_config/config-setup/config-setup
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ check_all_config_db_present()
do_config_migration()
{
# Identify list of files to migrate
copy_list="minigraph.xml snmp.yml acl.json frr telemetry"
copy_list="minigraph.xml snmp.yml acl.json port_config.json frr telemetry"

# Migrate all configuration files from old to new
copy_config_files_and_directories $copy_list
Expand Down
6 changes: 6 additions & 0 deletions files/image_config/platform/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ migrate_nos_configuration()
MG_FILE=$NOS_DIR/minigraph.xml
ACL_GZFILE=$NOS_DIR/acl.json.gz.base64.txt
ACL_FILE=$NOS_DIR/acl.json
PORT_CONFIG_GZFILE=$NOS_DIR/port_config.json.gz.base64.txt
PORT_CONFIG_FILE=$NOS_DIR/port_config.json
SNMP_FILE=$NOS_DIR/snmp.yml
mkdir -p $NOS_DIR

Expand All @@ -131,11 +133,13 @@ migrate_nos_configuration()
# decode & unzip minigraph.xml.gz.base64.txt
[ -f $MG_GZFILE ] && /usr/bin/base64 -d $MG_GZFILE | /bin/gunzip > $MG_FILE
[ -f $ACL_GZFILE ] && /usr/bin/base64 -d $ACL_GZFILE | /bin/gunzip > $ACL_FILE
[ -f $PORT_CONFIG_GZFILE ] && /usr/bin/base64 -d $PORT_CONFIG_GZFILE | /bin/gunzip > $PORT_CONFIG_FILE

# Copy relevant files
nos_migration_import $NOS_DIR/mgmt_interface.cfg /host/migration
nos_migration_import $MG_FILE /host/migration
nos_migration_import $ACL_FILE /host/migration
nos_migration_import $PORT_CONFIG_FILE /host/migration
nos_migration_import $SNMP_FILE /host/migration

if [ "$sonic_fast_reboot" == true ]; then
Expand Down Expand Up @@ -243,12 +247,14 @@ if [ -f $FIRST_BOOT_FILE ]; then
mkdir -p /etc/sonic/old_config
mv /host/minigraph.xml /etc/sonic/old_config/
[ -f /host/acl.json ] && mv /host/acl.json /etc/sonic/old_config/
[ -f /host/port_config.json ] && mv /host/port_config.json /etc/sonic/old_config/
[ -f /host/snmp.yml ] && mv /host/snmp.yml /etc/sonic/old_config/
touch /tmp/pending_config_migration
elif [ -n "$migration" ] && [ -f /host/migration/minigraph.xml ]; then
mkdir -p /etc/sonic/old_config
mv /host/migration/minigraph.xml /etc/sonic/old_config/
[ -f /host/migration/acl.json ] && mv /host/migration/acl.json /etc/sonic/old_config/
[ -f /host/migration/port_config.json ] && mv /host/migration/port_config.json /etc/sonic/old_config/
[ -f /host/migration/snmp.yml ] && mv /host/migration/snmp.yml /etc/sonic/old_config/
touch /tmp/pending_config_migration
[ -f /etc/sonic/updategraph.conf ] && sed -i -e "s/enabled=false/enabled=true/g" /etc/sonic/updategraph.conf
Expand Down
1 change: 1 addition & 0 deletions files/image_config/secureboot/allowlist_paths.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ etc/sonic/acl.json
etc/sonic/config_db.json
etc/sonic/minigraph.xml
etc/sonic/old_config/.*
etc/sonic/port_config.json
etc/sonic/snmp.yml
etc/sonic/sonic-environment
etc/sonic/updategraph.conf
Expand Down