Skip to content

Commit ac61d80

Browse files
[Arista][DNX] Workaround for sai.profile being empty when syncd starts (#1770)
We're seeing an issue where start.sh is run multiple times on syncd startup and if the 'cp' operation in the 2nd start.sh occurs while the Syncd process is reading the /etc/sai.d/sai.profile it will end up reading an empty file. Therefor if we skip the 'cp' operation when the file is unchanged the 2nd start.sh run should always be a no-op. This is a workaround until we find the reason and solution to stop start.sh from running multiple times.
1 parent c1ee3f7 commit ac61d80

File tree

1 file changed

+10
-0
lines changed
  • platform/broadcom/docker-syncd-brcm-dnx

1 file changed

+10
-0
lines changed

platform/broadcom/docker-syncd-brcm-dnx/start.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ else
2626
sonic-cfggen -d -t $HWSKU_DIR/config.bcm.j2 > /etc/sai.d/config.bcm
2727
fi
2828
if [ -f $HWSKU_DIR/sai.profile ]; then
29+
if [ ! -z $(grep "aboot_platform=.*arista" "/etc/machine.conf") ]; then
30+
if [ -f /etc/sai.d/sai.profile ]; then
31+
hashSrc=$(md5sum $HWSKU_DIR/sai.profile | cut -d ' ' -f 1)
32+
hashDst=$(md5sum /etc/sai.d/sai.profile | cut -d ' ' -f 1)
33+
if [ "${hashSrc}" == "${hashDst}" ]; then
34+
logger -p info "Arista: sai.profile unchanged, skip copying"
35+
exit 0
36+
fi
37+
fi
38+
fi
2939
cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile
3040
fi
3141
fi

0 commit comments

Comments
 (0)