@@ -126,19 +126,31 @@ if [ ! -e /host/machine.conf ]; then
126
126
127
127
if [ -n " $nos_dev " ]; then
128
128
# Mount the previous NOS's partition
129
- mkdir -p /mnt/nos_migration
130
- mount $nos_dev /mnt/nos_migration
129
+ NOS_DIR=/mnt/nos_migration
130
+ MG_GZFILE=$NOS_DIR /minigraph.xml.gz.base64.txt
131
+ MG_FILE=$NOS_DIR /minigraph.xml
132
+ ACL_GZFILE=$NOS_DIR /acl.json.gz.base64.txt
133
+ ACL_FILE=$NOS_DIR /acl.json
134
+ SNMP_FILE=$NOS_DIR /snmp.yml
135
+ mkdir -p $NOS_DIR
136
+ mount $nos_dev $NOS_DIR
131
137
mkdir -p /host/fast-reboot
132
138
139
+ # decode & unzip minigraph.xml.gz.base64.txt
140
+ [ -f $MG_GZFILE ] && /usr/bin/base64 -d $MG_GZFILE | /bin/gunzip > $MG_FILE
141
+ [ -f $ACL_GZFILE ] && /usr/bin/base64 -d $ACL_GZFILE | /bin/gunzip > $ACL_FILE
142
+
133
143
# Copy relevant files
134
- nos_migration_import /mnt/nos_migration/mgmt_interface.cfg /host/migration
135
- nos_migration_import /mnt/nos_migration/minigraph.xml /host/migration
136
- nos_migration_import /mnt/nos_migration/arp.json /host/fast-reboot
137
- nos_migration_import /mnt/nos_migration/fdb.json /host/fast-reboot
138
- nos_migration_import /mnt/nos_migration/default_routes.json /host/fast-reboot
139
-
140
- umount /mnt/nos_migration
141
- rmdir /mnt/nos_migration
144
+ nos_migration_import $NOS_DIR /mgmt_interface.cfg /host/migration
145
+ nos_migration_import $MG_FILE /host/migration
146
+ nos_migration_import $ACL_FILE /host/migration
147
+ nos_migration_import $SNMP_FILE /host/migration
148
+ nos_migration_import $NOS_DIR /arp.json /host/fast-reboot
149
+ nos_migration_import $NOS_DIR /fdb.json /host/fast-reboot
150
+ nos_migration_import $NOS_DIR /default_routes.json /host/fast-reboot
151
+
152
+ umount $NOS_DIR
153
+ rmdir $NOS_DIR
142
154
fi
143
155
144
156
update_mgmt_interface_macaddr /host/migration/mgmt_interface.cfg
@@ -196,6 +208,8 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then
196
208
elif [ -n " $migration " ] && [ -f /host/migration/minigraph.xml ]; then
197
209
mkdir -p /etc/sonic/old_config
198
210
mv /host/migration/minigraph.xml /etc/sonic/old_config/
211
+ [ -f /host/migration/acl.json ] && mv /host/migration/acl.json /etc/sonic/old_config/
212
+ [ -f /host/migration/snmp.yml ] && mv /host/migration/snmp.yml /etc/sonic/old_config/
199
213
touch /tmp/pending_config_migration
200
214
[ -f /etc/sonic/updategraph.conf ] && sed -i -e " s/enabled=false/enabled=true/g" /etc/sonic/updategraph.conf
201
215
else
0 commit comments