From 209c0695c836a2c992223748f7dc191eb250748d Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 29 Sep 2021 05:42:36 +0000 Subject: [PATCH] Using hwsku to idenfity platform in vs instead of fakeplatform Signed-off-by: Sudharsan Dhamal Gopalarathnam --- platform/vs/docker-sonic-vs/Dockerfile.j2 | 1 + platform/vs/docker-sonic-vs/orchagent.sh | 11 ++++++++--- platform/vs/docker-sonic-vs/start.sh | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index ab686d3a13de..b0ca08415488 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -176,6 +176,7 @@ COPY ["buffermgrd.sh", "/usr/bin/"] COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/"] +COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Mellanox-SN2700/"] # Workaround the tcpdump issue RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump diff --git a/platform/vs/docker-sonic-vs/orchagent.sh b/platform/vs/docker-sonic-vs/orchagent.sh index 4a035a26b292..62ddc76cce6a 100755 --- a/platform/vs/docker-sonic-vs/orchagent.sh +++ b/platform/vs/docker-sonic-vs/orchagent.sh @@ -1,9 +1,14 @@ #!/usr/bin/env bash -if [[ -z "$fake_platform" ]]; then - export platform=vs -else +#This is required since we have platform based checks in orchagent +#fakeplatform to be removed once swss migrates to hw-sku + +if [ "$HWSKU" == "Mellanox-SN2700" ]; then + export platform="mellanox" +elif [ -n "$fake_platform" ]; then export platform=$fake_platform +else + export platform=vs fi SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2 diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 047918d2e518..1709ccad92e2 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -53,10 +53,15 @@ else fi sonic-cfggen -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.json +#To be removed once swss migrates to HWSKU if [ "$fake_platform" == "mellanox" ]; then cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile fi +if [ "$HWSKU" == "Mellanox-SN2700" ]; then + cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile +fi + mkdir -p /etc/swss/config.d/ rm -f /var/run/rsyslogd.pid