diff options
| author | Christopher Larson <chris_larson@mentor.com> | 2015-11-10 21:24:58 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-25 08:08:15 +0000 |
| commit | 1732a8a92477db4842780e15268a0320287762c2 (patch) | |
| tree | a2037d403791f8d66a8f25b2442382097c73a1d3 /meta | |
| parent | 160fdd846e4f8b3d5bb15dd7c9a07f4ee16a7479 (diff) | |
| download | poky-1732a8a92477db4842780e15268a0320287762c2.tar.gz | |
bluez5: enable sysvinit support
This is from Shrikant Bobade <Shrikant_Bobade@mentor.com>.
(From OE-Core rev: f4c16f53af27ad459e77ae7f43e7bf1bad70645a)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-connectivity/bluez5/bluez5.inc | 8 | ||||
| -rw-r--r-- | meta/recipes-connectivity/bluez5/bluez5/init | 68 |
2 files changed, 75 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc index df42c88b9d..13fd600296 100644 --- a/meta/recipes-connectivity/bluez5/bluez5.inc +++ b/meta/recipes-connectivity/bluez5/bluez5.inc | |||
| @@ -18,10 +18,11 @@ PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental," | |||
| 18 | 18 | ||
| 19 | SRC_URI = "\ | 19 | SRC_URI = "\ |
| 20 | ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ | 20 | ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ |
| 21 | file://init \ | ||
| 21 | " | 22 | " |
| 22 | S = "${WORKDIR}/bluez-${PV}" | 23 | S = "${WORKDIR}/bluez-${PV}" |
| 23 | 24 | ||
| 24 | inherit autotools-brokensep pkgconfig systemd | 25 | inherit autotools-brokensep pkgconfig systemd update-rc.d |
| 25 | 26 | ||
| 26 | EXTRA_OECONF = "\ | 27 | EXTRA_OECONF = "\ |
| 27 | --enable-tools \ | 28 | --enable-tools \ |
| @@ -42,6 +43,9 @@ NOINST_TOOLS = " \ | |||
| 42 | " | 43 | " |
| 43 | 44 | ||
| 44 | do_install_append() { | 45 | do_install_append() { |
| 46 | install -d ${D}${INIT_D_DIR} | ||
| 47 | install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth | ||
| 48 | |||
| 45 | install -d ${D}${sysconfdir}/bluetooth/ | 49 | install -d ${D}${sysconfdir}/bluetooth/ |
| 46 | if [ -f ${S}/profiles/audio/audio.conf ]; then | 50 | if [ -f ${S}/profiles/audio/audio.conf ]; then |
| 47 | install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/ | 51 | install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/ |
| @@ -100,5 +104,7 @@ FILES_${PN}-dbg += "\ | |||
| 100 | RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject" | 104 | RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject" |
| 101 | 105 | ||
| 102 | SYSTEMD_SERVICE_${PN} = "bluetooth.service" | 106 | SYSTEMD_SERVICE_${PN} = "bluetooth.service" |
| 107 | INITSCRIPT_PACKAGES = "${PN}" | ||
| 108 | INITSCRIPT_NAME_${PN} = "bluetooth" | ||
| 103 | 109 | ||
| 104 | EXCLUDE_FROM_WORLD = "1" | 110 | EXCLUDE_FROM_WORLD = "1" |
diff --git a/meta/recipes-connectivity/bluez5/bluez5/init b/meta/recipes-connectivity/bluez5/bluez5/init new file mode 100644 index 0000000000..1606a5c663 --- /dev/null +++ b/meta/recipes-connectivity/bluez5/bluez5/init | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
| 4 | DESC=bluetooth | ||
| 5 | |||
| 6 | DAEMON=/usr/lib/bluez5/bluetooth/bluetoothd | ||
| 7 | |||
| 8 | # If you want to be ignore error of "org.freedesktop.hostname1", | ||
| 9 | # please enable NOPLUGIN_OPTION. | ||
| 10 | # NOPLUGIN_OPTION="--noplugin=hostname" | ||
| 11 | NOPLUGIN_OPTION="" | ||
| 12 | SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION" | ||
| 13 | |||
| 14 | test -f $DAEMON || exit 0 | ||
| 15 | |||
| 16 | # FIXME: any of the sourced files may fail if/with syntax errors | ||
| 17 | test -f /etc/default/bluetooth && . /etc/default/bluetooth | ||
| 18 | test -f /etc/default/rcS && . /etc/default/rcS | ||
| 19 | |||
| 20 | set -e | ||
| 21 | |||
| 22 | case $1 in | ||
| 23 | start) | ||
| 24 | echo "Starting $DESC" | ||
| 25 | |||
| 26 | if test "$BLUETOOTH_ENABLED" = 0; then | ||
| 27 | echo "disabled. see /etc/default/bluetooth" | ||
| 28 | exit 0 | ||
| 29 | fi | ||
| 30 | |||
| 31 | start-stop-daemon --start --background $SSD_OPTIONS | ||
| 32 | echo "${DAEMON##*/}" | ||
| 33 | |||
| 34 | ;; | ||
| 35 | stop) | ||
| 36 | echo "Stopping $DESC" | ||
| 37 | if test "$BLUETOOTH_ENABLED" = 0; then | ||
| 38 | echo "disabled." | ||
| 39 | exit 0 | ||
| 40 | fi | ||
| 41 | start-stop-daemon --stop $SSD_OPTIONS | ||
| 42 | echo "${DAEMON}" | ||
| 43 | ;; | ||
| 44 | restart|force-reload) | ||
| 45 | $0 stop | ||
| 46 | sleep 1 | ||
| 47 | $0 start | ||
| 48 | ;; | ||
| 49 | status) | ||
| 50 | pidof ${DAEMON} >/dev/null | ||
| 51 | status=$? | ||
| 52 | if [ $status -eq 0 ]; then | ||
| 53 | echo "bluetooth is running." | ||
| 54 | else | ||
| 55 | echo "bluetooth is not running" | ||
| 56 | fi | ||
| 57 | exit $status | ||
| 58 | ;; | ||
| 59 | *) | ||
| 60 | N=/etc/init.d/bluetooth | ||
| 61 | echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 | ||
| 62 | exit 1 | ||
| 63 | ;; | ||
| 64 | esac | ||
| 65 | |||
| 66 | exit 0 | ||
| 67 | |||
| 68 | # vim:noet | ||
