From 5a2b538bcd61f70ad129d9954834948ddb2aa014 Mon Sep 17 00:00:00 2001 From: David Escalona Date: Thu, 30 Mar 2017 09:41:43 +0200 Subject: [PATCH] bluetooth-init: force hardware-init script to be executed first - The Bluetooth daemon was always executed before setting up the hardware, generating several problems specifically in the CCIMX6SBC. This was causing the Bluetooth driver to override the Bluetooth name and alias, as well as avoiding any host function on Bluetooth profiles. Only pairing and ping was working, as well as client profile sides. - This change also fixes some issues in the CCIMX6UL platforms with the Bluetooth daemon failing to perform several bluetoothctl operations. https://jira.digi.com/browse/DEL-4000 https://jira.digi.com/browse/DEL-4015 Signed-off-by: David Escalona --- .../recipes-connectivity/bluez/bluez5_5.41.bbappend | 1 + .../recipes-core/busybox/busybox-1.24.1/ccimx6/suspend | 7 ++++++- .../recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend index c6edca2b5..66270a361 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.41.bbappend @@ -45,5 +45,6 @@ FILES_${PN}-init = "${sysconfdir}/init.d/bluetooth-init" INITSCRIPT_PACKAGES += "${PN}-init" INITSCRIPT_NAME_${PN}-init = "bluetooth-init" +INITSCRIPT_PARAMS_${PN}-init = "start 19 2 3 4 5 . stop 21 0 1 6 ." PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend index 6888311e4..ceded7b74 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend @@ -21,6 +21,7 @@ lockfile="/var/lock/${scriptname}.lock" lockfd="9" BT_INIT="/etc/init.d/bluetooth-init" +BT_DAEMON="/etc/init.d/bluetooth" usage() { printf "\nSuspend system to RAM memory\n" @@ -37,6 +38,7 @@ suspend_interfaces() { # Suspend bluetooth interface hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" + ${BT_DAEMON} stop >/dev/null ${BT_INIT} stop >/dev/null } @@ -47,7 +49,10 @@ resume_interfaces() { fi # Resume bluetooth interface - [ -n "${up_bt_on_resume}" ] && ${BT_INIT} start >/dev/null + if [ -n "${up_bt_on_resume}" ]; then + ${BT_INIT} start >/dev/null + ${BT_DAEMON} start >/dev/null + fi } enter_critical_section() { diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend index e213f45fe..33086f979 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend @@ -21,6 +21,7 @@ lockfile="/var/lock/${scriptname}.lock" lockfd="9" BT_INIT="/etc/init.d/bluetooth-init" +BT_DAEMON="/etc/init.d/bluetooth" usage() { printf "\nSuspend system to RAM memory\n" @@ -40,6 +41,7 @@ suspend_interfaces() { # Suspend bluetooth interface hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" + ${BT_DAEMON} stop >/dev/null ${BT_INIT} stop >/dev/null } @@ -50,7 +52,10 @@ resume_interfaces() { fi # Resume bluetooth interface - [ -n "${up_bt_on_resume}" ] && ${BT_INIT} start >/dev/null + if [ -n "${up_bt_on_resume}" ]; then + ${BT_INIT} start >/dev/null + ${BT_DAEMON} start >/dev/null + fi } enter_critical_section() {