Skip to content

Commit 6435df1

Browse files
[config-topology] use cached variables (#17343)
- Why I did it Improve boot performance mostly needed for fast and warmboot - How I did it Use cached variable. - How to verify it Boot the system. Simply do "systemd-analyze blame" and look at service start time. Signed-off-by: Stepan Blyschak <[email protected]>
1 parent 000a2ef commit 6435df1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

files/image_config/config-topology/config-topology.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# which could be used for platform specific topology configuration
55
#
66
start() {
7-
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
7+
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
88
#Path to platform topology script
99
TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh"
1010
#if topology script file not present, do nothing and return 0
@@ -13,7 +13,7 @@ start() {
1313
}
1414

1515
stop() {
16-
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
16+
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
1717
#Path to platform topology script
1818
TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh"
1919
#if topology script file not present, do nothing and return 0

0 commit comments

Comments
 (0)