Skip to content

Commit

Permalink
Patch init script with saithrift start parameters. (sonic-net#52)
Browse files Browse the repository at this point in the history
* Patch init script with saithrift start parameters.

Add portmap file for saithrift server

* Don't remove msn2700_portmap. Refactor saithrift logic in init script
  • Loading branch information
pavel-shirshov authored and lguohan committed Aug 9, 2016
1 parent b135405 commit 76533a9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
12 changes: 12 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,17 @@ DEB_SAI_FLAVOR ?= "bcm"
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

ifeq ($(findstring --enable-rpcserver=yes,${CONFIGURE_ARGS}),--enable-rpcserver=yes)
saithrift = yes
else
saithrift = no
endif

override_dh_auto_configure:
dh_auto_configure -- --with-sai=$(DEB_SAI_FLAVOR) ${CONFIGURE_ARGS}

override_dh_installinit:
ifeq ($(saithrift), yes)
sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd.init
endif
dh_installinit
5 changes: 5 additions & 0 deletions debian/syncd.init
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DAEMON_SYNCD=/usr/bin/syncd
# dsserve: domain socket server for stdio
DAEMON_DSSERVE=/usr/bin/dsserve
DAEMON_DSSERVE_ARGS="-d $DAEMON_SYNCD --diag"
ENABLE_SAITHRIFT=0

if [ -x $DAEMON_DSSERVE ]; then
DAEMON=$DAEMON_DSSERVE
Expand Down Expand Up @@ -50,6 +51,10 @@ start)
elif [ "$onie_platform" == "x86_64-mlnx_x86-r5.0.1400" ]; then
start_mlnx
DAEMON_ARGS="-p /etc/syncd.d/mlnx_2700.profile -N"

if [ ${ENABLE_SAITHRIFT} == 1 ]; then
DAEMON_ARGS+="-r -m /etc/syncd.d/msn2700_port_map.ini"
fi
fi

start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS
Expand Down
33 changes: 33 additions & 0 deletions etc/syncd.d/msn2700_port_map.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# alias lanes
Ethernet1 0,1,2,3
Ethernet2 4,5,6,7
Ethernet3 8,9,10,11
Ethernet4 12,13,14,15
Ethernet5 16,17,18,19
Ethernet6 20,21,22,23
Ethernet7 24,25,26,27
Ethernet8 28,29,30,31
Ethernet9 32,33,34,35
Ethernet10 36,37,38,39
Ethernet11 40,41,42,43
Ethernet12 44,45,46,47
Ethernet13 48,49,50,51
Ethernet14 52,53,54,55
Ethernet15 56,57,58,59
Ethernet16 60,61,62,63
Ethernet17 64,65,66,67
Ethernet18 68,69,70,71
Ethernet19 72,73,74,75
Ethernet20 76,77,78,79
Ethernet21 80,81,82,83
Ethernet22 84,85,86,87
Ethernet23 88,89,90,91
Ethernet24 92,93,94,95
Ethernet25 96,97,98,99
Ethernet26 100,101,102,103
Ethernet27 104,105,106,107
Ethernet28 108,109,110,111
Ethernet29 112,113,114,115
Ethernet30 116,117,118,119
Ethernet31 120,121,122,123
Ethernet32 124,125,126,127

0 comments on commit 76533a9

Please sign in to comment.