From 191a08626625086ba84f91b16dec09c3b0f3e8ea Mon Sep 17 00:00:00 2001 From: Volodymyr Boyko Date: Thu, 13 Aug 2020 21:24:38 -0700 Subject: [PATCH] [barefoot] Switch to Y profiles for Newport board Signed-off-by: Volodymyr Boyko --- .../x86_64-accton_as9516bf_32d-r0/syncd.conf | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 device/barefoot/x86_64-accton_as9516bf_32d-r0/syncd.conf diff --git a/device/barefoot/x86_64-accton_as9516bf_32d-r0/syncd.conf b/device/barefoot/x86_64-accton_as9516bf_32d-r0/syncd.conf new file mode 100644 index 000000000000..6035b97b9834 --- /dev/null +++ b/device/barefoot/x86_64-accton_as9516bf_32d-r0/syncd.conf @@ -0,0 +1,23 @@ +#!/bin/bash + + +y_profile_set() { + P4_PROFILE=$(sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["p4_profile"]') + if [[ -n "$P4_PROFILE" || ( ! -L /opt/bfn/install && -e /opt/bfn/install ) ]]; then + return + fi + + Y_PROFILE=$(ls -d /opt/bfn/install_y*_profile 2> /dev/null | head -1) + if [[ -z $Y_PROFILE ]]; then + echo "No P4 profile found for Newport" + return + fi + + ln -srfn $Y_PROFILE /opt/bfn/install +} + +( + unset PYTHONPATH + unset PYTHONHOME + y_profile_set +)