Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change centec way of passing mac-address arg from sai.profile to -m param with orchagent #317

Merged
merged 1 commit into from
May 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,14 @@ config_syncd_mlnx()

config_syncd_centec()
{
CMD_ARGS+=" -p /tmp/sai.profile"
CMD_ARGS+=" -p $HWSKU_DIR/sai.profile"

[ -e /dev/linux_dal ] || mknod /dev/linux_dal c 198 0
[ -e /dev/net/tun ] || ( mkdir -p /dev/net && mknod /dev/net/tun c 10 200 )

# Read MAC address and align the last 6 bits.
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
last_byte=$(python -c "print '$MAC_ADDRESS'[-2:]")
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix
ALIGNED_MAC_ADDRESS=$(python -c "print '$MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC

# Write MAC address into /tmp/profile file.
cat $HWSKU_DIR/sai.profile > /tmp/sai.profile
echo "DEVICE_MAC_ADDRESS=$ALIGNED_MAC_ADDRESS" >> /tmp/sai.profile

if [ $FAST_REBOOT == "yes" ]; then
CMD_ARGS+=" -t fast"
fi
}

config_syncd_cavium()
Expand Down