summaryrefslogtreecommitdiff
path: root/recipes-connectivity/bluez
diff options
context:
space:
mode:
authorVyacheslav Pedash <vyacheslav.pedash@globallogic.com>2021-02-02 15:31:07 +0200
committerVyacheslav Pedash <vyacheslav.pedash@globallogic.com>2021-02-02 15:40:52 +0200
commit7a5d1ad54702ab46660fc04d334c33c3cb3bddb5 (patch)
treedf15bef503b907f9cfc8b5b9fb91a9f3b9492978 /recipes-connectivity/bluez
parentc3f271f5cf9bbc82f4776980fd0e4d1a0df4d3fe (diff)
downloadmeta-mlinux-7a5d1ad54702ab46660fc04d334c33c3cb3bddb5.tar.gz
meta-mlinux-7a5d1ad54702ab46660fc04d334c33c3cb3bddb5.tar.bz2
meta-mlinux-7a5d1ad54702ab46660fc04d334c33c3cb3bddb5.zip
MTX-3787 Restore bluez init script
Diffstat (limited to 'recipes-connectivity/bluez')
-rwxr-xr-xrecipes-connectivity/bluez/bluez5/init72
-rw-r--r--recipes-connectivity/bluez/bluez5_%.bbappend1
2 files changed, 73 insertions, 0 deletions
diff --git a/recipes-connectivity/bluez/bluez5/init b/recipes-connectivity/bluez/bluez5/init
new file mode 100755
index 0000000..4d84195
--- /dev/null
+++ b/recipes-connectivity/bluez/bluez5/init
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC=bluetooth
+
+DAEMON=/usr/libexec/bluetooth/bluetoothd
+
+# If you want to be ignore error of "org.freedesktop.hostname1",
+# please enable NOPLUGIN_OPTION.
+# NOPLUGIN_OPTION="--noplugin=hostname"
+NOPLUGIN_OPTION=""
+SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION"
+
+test -f $DAEMON || exit 0
+
+# FIXME: any of the sourced files may fail if/with syntax errors
+test -f /etc/default/bluetooth && . /etc/default/bluetooth
+test -f /etc/default/rcS && . /etc/default/rcS
+
+set -e
+
+case $1 in
+ start)
+ echo "Starting $DESC"
+
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled. see /etc/default/bluetooth"
+ exit 0
+ fi
+
+ start-stop-daemon --start --background $SSD_OPTIONS $MOREOPTIONS
+ sleep 1
+ if [[ -n ${BLUETOOTHCTL_CMD} ]] ; then
+ echo -e "${BLUETOOTHCTL_CMD}" | /usr/bin/bluetoothctl 2>&1 | logger -t bluetoothctl -p daemon.info
+ fi
+ echo "${DAEMON##*/}"
+
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled."
+ exit 0
+ fi
+ start-stop-daemon --stop $SSD_OPTIONS
+ echo "${DAEMON}"
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ pidof ${DAEMON} >/dev/null
+ status=$?
+ if [ $status -eq 0 ]; then
+ echo "bluetooth is running."
+ else
+ echo "bluetooth is not running"
+ fi
+ exit $status
+ ;;
+ *)
+ N=/etc/init.d/bluetooth
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# vim:noet
diff --git a/recipes-connectivity/bluez/bluez5_%.bbappend b/recipes-connectivity/bluez/bluez5_%.bbappend
index 15f7fd4..c484558 100644
--- a/recipes-connectivity/bluez/bluez5_%.bbappend
+++ b/recipes-connectivity/bluez/bluez5_%.bbappend
@@ -11,6 +11,7 @@ RDEPENDS_${PN}-rfcomm += "bash python-pygobject python-syslog python-logging pyt
RDEPENDS_bluez5 += "bash"
SRC_URI += "\
+ file://init \
file://default \
file://main.conf \
file://bt-pan/init \