Skip to content

Commit

Permalink
[rc.local]: Copy saved minigraph if available. (#533)
Browse files Browse the repository at this point in the history
* [rc.local]: Copy saved minigraph if available.

In case of sonic-to-sonic update old image stores minigraph under /host
directory. Upon first boot this minigraph will be used by new image to
save configuration.

Signed-off-by: marian-pritsak <[email protected]>
  • Loading branch information
marian-pritsak authored and oleksandrivantsiv committed Apr 26, 2017
1 parent 147b89f commit d597418
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion files/image_config/platform/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then
exit 0
fi

cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/
# Try to take minigraph saved during installation
if [ -f /host/minigraph.xml ]; then
mv /host/minigraph.xml /etc/sonic/
else
cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/
fi

if [ -d /host/image-$sonic_version/platform/$platform ]; then
dpkg -i /host/image-$sonic_version/platform/$platform/*.deb
Expand Down

0 comments on commit d597418

Please sign in to comment.