Skip to content

Commit

Permalink
[docker-sonic-vs] Create /usr/share/sonic/platform symlink (sonic-net…
Browse files Browse the repository at this point in the history
…#5268)

Copying platform.json file into an empty /usr/share/sonic/platform directory does not mimic an actual device. A more correct approach is to create a /usr/share/sonic/platform symlink which links to the actual platform directory; this is more like what is done inside SONiC containers. Then, we only need to copy the platform.json file into the actual platform directory; the symlink takes care of the alternative path, and also exposes all the other files in the platform directory.
  • Loading branch information
jleveque authored and santhosh-kt committed Feb 25, 2021
1 parent 4891cf0 commit 95bd4d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ COPY ["chassis_db.py", "/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 ["platform.json", "/usr/share/sonic/platform/"]

# Workaround the tcpdump issue
RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
Expand Down
1 change: 1 addition & 0 deletions platform/vs/docker-sonic-vs/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# NOTE: 'PLATFORM' and 'HWSKU' environment variables are set
# in the Dockerfile so that they persist for the life of the container

ln -sf /usr/share/sonic/device/$PLATFORM /usr/share/sonic/platform
ln -sf /usr/share/sonic/device/$PLATFORM/$HWSKU /usr/share/sonic/hwsku

pushd /usr/share/sonic/hwsku
Expand Down

0 comments on commit 95bd4d3

Please sign in to comment.