Skip to content

Commit 2b67f5d

Browse files
yangbashuangpavel-shirshov
authored andcommitted
change centec way of passing mac-address arg from sai.profile to -m param with orchagent (sonic-net#317)
1 parent 343744c commit 2b67f5d

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

syncd/scripts/syncd_init_common.sh

+5-11
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,14 @@ config_syncd_mlnx()
7070

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

7575
[ -e /dev/linux_dal ] || mknod /dev/linux_dal c 198 0
7676
[ -e /dev/net/tun ] || ( mkdir -p /dev/net && mknod /dev/net/tun c 10 200 )
77-
78-
# Read MAC address and align the last 6 bits.
79-
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
80-
last_byte=$(python -c "print '$MAC_ADDRESS'[-2:]")
81-
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix
82-
ALIGNED_MAC_ADDRESS=$(python -c "print '$MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC
83-
84-
# Write MAC address into /tmp/profile file.
85-
cat $HWSKU_DIR/sai.profile > /tmp/sai.profile
86-
echo "DEVICE_MAC_ADDRESS=$ALIGNED_MAC_ADDRESS" >> /tmp/sai.profile
77+
78+
if [ $FAST_REBOOT == "yes" ]; then
79+
CMD_ARGS+=" -t fast"
80+
fi
8781
}
8882

8983
config_syncd_cavium()

0 commit comments

Comments
 (0)