Skip to content

Commit

Permalink
pkg: Adding syncd.init file for Broadcom SAI (sonic-net#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
stcheng committed Apr 28, 2016
1 parent 8d119e6 commit 4e86aad
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
7 changes: 5 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ DEB_SAI_FLAVOR ?= "bcm"
override_dh_auto_configure:
dh_auto_configure -- --with-sai=$(DEB_SAI_FLAVOR)

override_dh_auto_install:
dh_auto_install
# 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
dh_installinit
27 changes: 27 additions & 0 deletions debian/syncd.bcm.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/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

case "$1" in
start)
[ -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
;;
stop)
;;
*)
echo "Usage: service syncd {start|stop}"
exit 1
;;
esac

exit 0

0 comments on commit 4e86aad

Please sign in to comment.