Skip to content

Commit

Permalink
[Mellanox] Resolve New Line Formatting Issues in syncd's sai.profile (s…
Browse files Browse the repository at this point in the history
…onic-net#1412)

On Mellanox platforms, the /tmp/sai.profile file inside syncd might end up with invalid formatting after running the script modified by this PR, such as missing new lines after concatenation or redundant new lines. This PR aims to fix that.
  • Loading branch information
tshalvi authored Oct 2, 2024
1 parent 9b9d330 commit 24843d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ config_syncd_mlnx()
cat $HWSKU_DIR/sai.profile > /tmp/sai-temp.profile
fi

echo >> /tmp/sai-temp.profile

if [[ -f $SAI_COMMON_FILE_PATH ]]; then
cat $SAI_COMMON_FILE_PATH >> /tmp/sai-temp.profile
fi
Expand Down Expand Up @@ -254,6 +256,9 @@ config_syncd_mlnx()
if [[ -f /tmp/sai_extra.profile ]]; then
cat /tmp/sai_extra.profile >> /tmp/sai.profile
fi

# Ensure no redundant newlines
sed -i '/^$/d' /tmp/sai.profile
}

config_syncd_centec()
Expand Down

0 comments on commit 24843d4

Please sign in to comment.