Skip to content

Commit

Permalink
[platform][barefoot] Install sonic_platform to host (#6644)
Browse files Browse the repository at this point in the history
- Why I did it
SONiC design requires sonic_platform package to be installed in SONiC host environment, not only in docker containers.

- How I did it
For now, sonic_platform python wheel package, that is used by pmon, is provided via device-specific platform modules deb packages that unpacks the wheel package file into specific device's directory on lazy-install.
The PR makes deb packages' postinst script also install these unpacked wheel packages to host.

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
  • Loading branch information
vboykox authored Feb 3, 2021
1 parent 580666a commit f8ddc39
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -e

PLATFORM_NAME=x86_64-accton_wedge100bf_32x-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}

#DEBHELPER#
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
#!/bin/sh
set -e
depmod -a
depmod -a
systemctl enable bfn-newport.service
systemctl start bfn-newport.service

PLATFORM_NAME=x86_64-accton_as9516bf_32d-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
if [ -e ${SONIC_PLATFORM_WHEEL_PY2} ]; then
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
fi
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
if [ -e ${SONIC_PLATFORM_WHEEL_PY3} ]; then
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}
fi

PLATFORM_NAME=x86_64-accton_as9516_32d-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
if [ -e ${SONIC_PLATFORM_WHEEL_PY2} ]; then
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
fi
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
if [ -e ${SONIC_PLATFORM_WHEEL_PY3} ]; then
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}
fi

#DEBHELPER#
10 changes: 10 additions & 0 deletions platform/barefoot/sonic-platform-modules-bfn/debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -e

PLATFORM_NAME=x86_64-accton_wedge100bf_65x-r0
SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl"
python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2}
SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl"
python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3}

#DEBHELPER#

0 comments on commit f8ddc39

Please sign in to comment.