pi-bluetooth: create to provide standard raspbian script for bluetooth setup

Unique bluetooth device addresses are not assigned correctly with some
firmware, resulting in a fixed default address.  Use the same utility as
raspbian does to initialize the device.

Closes #236

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2018-05-07 07:44:24 -05:00 committed by Andrei Gherzan
parent df56f0c6cc
commit 6aa54e92e3
3 changed files with 33 additions and 5 deletions

View File

@ -8,7 +8,7 @@ After=dev-serial1.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/hciattach -n /dev/serial1 bcm43xx 921600 noflow -
ExecStart=/usr/bin/btuart
[Install]
WantedBy=multi-user.target

View File

@ -8,14 +8,20 @@ BCM_BT_SOURCES = " \
file://brcm43438.service \
"
BCM_BT_SERVICE = "brcm43438.service"
enable_bcm_bluetooth() {
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/brcm43438.service ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/${BCM_BT_SERVICE} ${D}${systemd_unitdir}/system
fi
}
BCM_BT_SERVICE = " brcm43438.service"
BCM_BT_RDEPENDS = "\
udev-rules-rpi \
bluez-firmware-raspbian \
pi-bluetooth \
"
# for raspberrypi3
SRC_URI_append_raspberrypi3 = " ${BCM_BT_SOURCES}"
@ -26,7 +32,7 @@ do_install_append_raspberrypi3() {
SYSTEMD_SERVICE_${PN}_append_raspberrypi3 = " ${BCM_BT_SERVICE}"
RDEPENDS_${PN}_append_raspberrypi3 = " udev-rules-rpi bluez-firmware-raspbian"
RDEPENDS_${PN}_append_raspberrypi3 = " ${BCM_BT_RDEPENDS}"
# for raspberrypi0-wifi
SRC_URI_append_raspberrypi0-wifi = " ${BCM_BT_SOURCES}"
@ -37,4 +43,4 @@ do_install_append_raspberrypi0-wifi() {
SYSTEMD_SERVICE_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_SERVICE}"
RDEPENDS_${PN}_append_raspberrypi0-wifi = " udev-rules-rpi bluez-firmware-raspbian"
RDEPENDS_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_RDEPENDS}"

View File

@ -0,0 +1,22 @@
SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi"
HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth"
SECTION = "kernel"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "\
file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \
"
SRC_URI = "git://github.com/RPi-Distro/pi-bluetooth"
SRCREV = "2a7477966bb3c69838b224f3ea92cb49a88124d5"
UPSTREAM_VERSION_UNKNOWN = "1"
S = "${WORKDIR}/git"
inherit allarch
do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}/usr/bin/btuart ${D}${bindir}
}
FILES_${PN} = "${bindir}"