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 <david.escalona@digi.com>
This commit is contained in:
David Escalona 2017-03-30 09:41:43 +02:00
parent 98d514c1c2
commit 5a2b538bcd
3 changed files with 13 additions and 2 deletions

View File

@ -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}"

View File

@ -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() {

View File

@ -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() {