Skip to content

Commit

Permalink
unify syncd init script on different platforms and add s6100 support (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
lguohan authored and stcheng committed Jul 21, 2016
1 parent e39703c commit 293beb6
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 72 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ debian/libsairedis.postinst.debhelper
debian/libsairedis.postrm.debhelper
debian/libsairedis.substvars
debian/syncd.debhelper.log
debian/syncd.init
debian/syncd.postinst.debhelper
debian/syncd.postrm.debhelper
debian/syncd.prerm.debhelper
Expand Down
7 changes: 0 additions & 7 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,3 @@ DEB_SAI_FLAVOR ?= "bcm"

override_dh_auto_configure:
dh_auto_configure -- --with-sai=$(DEB_SAI_FLAVOR)

# SONiC:
# override dh_installinit to prepare init file for different SAI flavors
override_dh_installinit:
if [ "$(DEB_SAI_FLAVOR)" = "bcm" ]; then cp debian/syncd.bcm.init debian/syncd.init; fi
if [ "$(DEB_SAI_FLAVOR)" = "mlnx" ]; then cp debian/syncd.mlnx.init debian/syncd.init; fi
dh_installinit
32 changes: 0 additions & 32 deletions debian/syncd.bcm.init

This file was deleted.

47 changes: 47 additions & 0 deletions debian/syncd.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

### BEGIN INIT INFO
# Provides: syncd
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: SONiC sync daemon
# Description: Enable service syncd.
### END INIT INFO

DAEMON=/usr/bin/syncd

case "$1" in
start)
. /etc/machine.conf

if [ "$onie_platform" == "x86_64-dell_s6000_s1220-r0" ]; then
[ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0
[ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0
[ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0
elif [ "$onie_platform" == "x86_64-dell_s6100_c2538-r0" ]; then
[ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0
[ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0
[ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0

DAEMON_ARGS="-p /etc/syncd.d/dell_s6100.profile -N"
elif [ "onie_platform" == "x86_64-mlnx_x86-r5.0.1400" ]; then
mkdir -p /dev/sxdevs
[ -e /dev/sxdevs/sxcdev ] || mknod /dev/sxdevs/sxcdev c 231 193

DAEMON_ARGS="-p /etc/syncd.d/mlnx_2700.profile -N"
fi

start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS
;;
stop)
start-stop-daemon --stop --quiet --exec $DAEMON
;;
*)
echo "Usage: service syncd {start|stop}"
exit 1
;;
esac

exit 0
32 changes: 0 additions & 32 deletions debian/syncd.mlnx.init

This file was deleted.

1 change: 1 addition & 0 deletions etc/syncd.d/dell_s6100.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/th-s6100-64x40G.config.bcm

0 comments on commit 293beb6

Please sign in to comment.