From 25fa459defaae0b443be51bfaabbdcd196026793 Mon Sep 17 00:00:00 2001 From: Olivier Singla Date: Wed, 6 Feb 2019 15:51:12 -0500 Subject: [PATCH 1/2] Added the feature to run an option platform specific script on the first installation. We added the ability to run an optional platform specific script when the onie image is installed. This will be useful in the case of doing some switch specifc tasks. --- files/image_config/platform/rc.local | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 3596eb18419c..4035141c65bb 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -351,6 +351,10 @@ if [ -f $FIRST_BOOT_FILE ]; then mv /host/grub.cfg /host/grub/grub.cfg fi + # If there is a platform dependant script, execute it + if [ -x /usr/share/sonic/device/${onie_platform}/platform_setup ]; then + /usr/share/sonic/device/${onie_platform}/platform_setup + fi firsttime_exit fi From 8142b869e80a98ebe78e5d0b2b8f9b250cf73e50 Mon Sep 17 00:00:00 2001 From: Olivier Singla Date: Wed, 13 Feb 2019 14:51:52 -0500 Subject: [PATCH 2/2] Better use $platform instead of $device_platform --- files/image_config/platform/rc.local | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 4035141c65bb..3ba79f930312 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -352,8 +352,8 @@ if [ -f $FIRST_BOOT_FILE ]; then fi # If there is a platform dependant script, execute it - if [ -x /usr/share/sonic/device/${onie_platform}/platform_setup ]; then - /usr/share/sonic/device/${onie_platform}/platform_setup + if [ -x /usr/share/sonic/device/${platform}/platform_setup ]; then + /usr/share/sonic/device/${platform}/platform_setup fi firsttime_exit fi