diff options
author | Riku Voipio <riku.voipio@linaro.org> | 2013-11-29 17:44:04 +0200 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2013-11-29 17:45:40 +0200 |
commit | f1a127ef4cd649e91161f64e6a4ddb1585a92342 (patch) | |
tree | b46c7eda5e29860bdab9a9853dde79afc7366e90 | |
parent | bb3ad4ae7725ac10c56eb4d79f37bd442000d5f9 (diff) |
gator: add initscript
Add automatic start of gatord, help closing
https://bugs.launchpad.net/linaro-oe/+bug/1244104
https://bugs.launchpad.net/linaro-oe/+bug/1243688
Change-Id: I8c7a18d58e324c8fbfaaf11579d7677c215b771d
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rwxr-xr-x | meta-linaro/recipes-kernel/gator/gator/gator.init | 48 | ||||
-rw-r--r-- | meta-linaro/recipes-kernel/gator/gator_git.bb | 13 |
2 files changed, 59 insertions, 2 deletions
diff --git a/meta-linaro/recipes-kernel/gator/gator/gator.init b/meta-linaro/recipes-kernel/gator/gator/gator.init new file mode 100755 index 00000000..11ac3455 --- /dev/null +++ b/meta-linaro/recipes-kernel/gator/gator/gator.init @@ -0,0 +1,48 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: gatord +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts gatord +# Description: Starts the Gator Daemon for ARM DS5 +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="Gator" +NAME="gatord" +GATOR=`which $NAME` + +. /etc/init.d/functions || exit 1 + +# Exit if the package is not installed +[ -x "$GATOR" ] || exit 0 + +case "$1" in + start) + echo -n "Starting $DESC: $NAME... " + depmod -a||true + modprobe gator + start-stop-daemon -S -b -x $GATOR -- $GATOR_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: $NAME... " + start-stop-daemon -K -x $GATOR + echo "done." + ;; + restart) + echo "Restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-linaro/recipes-kernel/gator/gator_git.bb b/meta-linaro/recipes-kernel/gator/gator_git.bb index 6e15d441..8aed22f9 100644 --- a/meta-linaro/recipes-kernel/gator/gator_git.bb +++ b/meta-linaro/recipes-kernel/gator/gator_git.bb @@ -4,7 +4,10 @@ SUMMARY = "DS-5 Gator daemon" LICENSE = "GPL-2" LIC_FILES_CHKSUM = "file://driver/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRC_URI = "git://git.linaro.org/arm/ds5/gator.git" +inherit update-rc.d + +SRC_URI = "git://git.linaro.org/arm/ds5/gator.git \ + file://gator.init " SRCREV = "${AUTOREV}" @@ -20,5 +23,11 @@ do_compile() { } do_install() { - install -D -p -m0755 daemon/gatord ${D}/${sbindir}/gatord + install -D -p -m0755 daemon/gatord ${D}/${sbindir}/gatord + install -D -p -m0755 ${WORKDIR}/gator.init ${D}/${sysconfdir}/init.d/gator + } + +INITSCRIPT_NAME = "gator" +INITSCRIPT_PARAMS = "defaults 66" + |