Skip to content

Commit

Permalink
[config-topology] use cached variables (#17343)
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
stepanblyschak authored and mssonicbld committed Dec 9, 2023
1 parent 688245a commit bc4bc03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/image_config/config-topology/config-topology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# which could be used for platform specific topology configuration
#
start() {
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
#Path to platform topology script
TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh"
#if topology script file not present, do nothing and return 0
Expand All @@ -13,7 +13,7 @@ start() {
}

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

0 comments on commit bc4bc03

Please sign in to comment.