From edf54da072d426293a4a401e153ac569ba190450 Mon Sep 17 00:00:00 2001 From: marian-pritsak Date: Mon, 24 Apr 2017 16:58:38 +0300 Subject: [PATCH 1/2] [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 --- files/image_config/platform/rc.local | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index ee593aab88ae..b98c20429ef1 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -29,7 +29,11 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then exit 0 fi - cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/ + 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 From cbb440747c9dc10358fb44f7aba3e68584e18c5f Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Tue, 25 Apr 2017 10:42:18 +0300 Subject: [PATCH 2/2] Add comment --- files/image_config/platform/rc.local | 1 + 1 file changed, 1 insertion(+) diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index b98c20429ef1..26f59bf94aad 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -29,6 +29,7 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then exit 0 fi + # Try to take minigraph saved during installation if [ -f /host/minigraph.xml ]; then mv /host/minigraph.xml /etc/sonic/ else