From f6d1c4a5754f69b903ddfd78f51b9befadebee05 Mon Sep 17 00:00:00 2001 From: Myron Sosyak <49795530+msosyak@users.noreply.github.com> Date: Thu, 24 Dec 2020 20:27:52 +0200 Subject: [PATCH] [barefoot] Fix y_profile_set to not reset link (#6238) Y* profile is the name pattern for p4 programs that developed for the current platform. The difference between them is features enabled and resource reservation. For this platform, it is expected to work on any Y profile. but after the latest changes, the first Y profile is always used. --- device/barefoot/x86_64-accton_as9516_32d-r0/syncd.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/syncd.conf b/device/barefoot/x86_64-accton_as9516_32d-r0/syncd.conf index 6035b97b98..11956f83a5 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/syncd.conf +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/syncd.conf @@ -7,12 +7,18 @@ y_profile_set() { return fi + if [[ $(readlink /opt/bfn/install) =~ "install_y" ]]; then + echo "/opt/bfn/install is a link to Y profile" + 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 + echo "Link /opt/bfn/install to $Y_PROFILE" ln -srfn $Y_PROFILE /opt/bfn/install }