diff options
Diffstat (limited to 'recipes-connectivity/pi-bluetooth')
-rw-r--r-- | recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch | 35 | ||||
-rw-r--r-- | recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb (renamed from recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb) | 22 |
2 files changed, 40 insertions, 17 deletions
diff --git a/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch b/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch index 45b43c7..8766a77 100644 --- a/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch +++ b/recipes-connectivity/pi-bluetooth/pi-bluetooth/0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch @@ -3,25 +3,38 @@ From: "Peter A. Bigot" <pab@pabigot.com> Date: Wed, 14 Nov 2018 09:19:51 -0600 Subject: [PATCH] bthelper: correct path for hciconfig under Yocto -Upstream-Status: Inapproprate [OE-specific] +Upstream-Status: Inappropriate [OE-specific] Signed-off-by: Peter A. Bigot <pab@pabigot.com> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> --- - usr/bin/bthelper | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + usr/bin/bthelper | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/bin/bthelper b/usr/bin/bthelper -index af597e5..5de84f6 100755 +index 2133fbc..1fc9245 100755 --- a/usr/bin/bthelper +++ b/usr/bin/bthelper -@@ -10,7 +10,7 @@ fi +@@ -12,8 +12,8 @@ fi + dev=$1 - dev="$1" # Need to bring hci up before looking at MAC as it can be all zeros during init --/bin/hciconfig "$dev" up --/bin/hciconfig "$dev" | grep -qE "BD Address: (B8:27:EB|DC:A6:32):" || exit 0 -+/usr/bin/hciconfig "$dev" up -+/usr/bin/hciconfig "$dev" | grep -qE "BD Address: (B8:27:EB|DC:A6:32):" || exit 0 - /usr/bin/hcitool -i "$dev" cmd 0x3f 0x1c 0x01 0x02 0x00 0x01 0x01 > /dev/null +-/bin/hciconfig $dev up +-if ! /bin/hciconfig $dev | grep -q "Bus: UART"; then ++/usr/bin/hciconfig $dev up ++if ! /usr/bin/hciconfig $dev | grep -q "Bus: UART"; then + echo Not a UART-attached BT Modem + exit 0 + fi +@@ -26,7 +26,7 @@ if ( /usr/bin/hcitool -i $dev dev | grep -q -E '\s43:4[35]:' ); then + BDADDR=`printf '0x%02x 0x%02x 0x%02x 0xeb 0x27 0xb8' $((0x$B3 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B1 ^ 0xaa))` + /usr/bin/hcitool -i $dev cmd 0x3f 0x001 $BDADDR +- /bin/hciconfig $dev reset ++ /usr/bin/hciconfig $dev reset + else + echo Raspberry Pi BDADDR already set + fi +-- +2.31.1 + diff --git a/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb b/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb index ccf714b..1c3daff 100644 --- a/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.12.bb +++ b/recipes-connectivity/pi-bluetooth/pi-bluetooth_0.1.17.bb @@ -7,19 +7,21 @@ LIC_FILES_CHKSUM = "\ " SRC_URI = "\ - git://github.com/RPi-Distro/pi-bluetooth \ + git://github.com/RPi-Distro/pi-bluetooth;branch=master;protocol=https \ file://0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch \ " -SRCREV = "cbdbcb66bcc5b9af05f1a9fffe2254c872bb0ace" +SRCREV = "fd4775bf90e037551532fc214a958074830bb80d" S = "${WORKDIR}/git" +inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'update-rc.d', d)} # hciuart.service replaces what was brcm43438.service -inherit systemd -SYSTEMD_SERVICE_${PN} = "\ +SYSTEMD_SERVICE:${PN} = "\ hciuart.service \ bthelper@.service \ " +INITSCRIPT_NAME = "btuart" +INITSCRIPT_PARAMS = "start 18 2 3 4 5 ." do_install() { install -d ${D}${sysconfdir}/udev/rules.d @@ -33,15 +35,23 @@ do_install() { install -d ${D}${systemd_system_unitdir} install -m 0644 ${S}/debian/pi-bluetooth.bthelper@.service ${D}${systemd_system_unitdir}/bthelper@.service install -m 0644 ${S}/debian/pi-bluetooth.hciuart.service ${D}${systemd_system_unitdir}/hciuart.service + else + install -d ${D}${sysconfdir}/init.d/ + cat > ${WORKDIR}/btuart.init << EOF +#!/bin/sh +/usr/bin/btuart +EOF + install -m 0755 ${WORKDIR}/btuart.init ${D}${sysconfdir}/init.d/btuart + sed -i -e 's:TAG+="systemd".*$:RUN+="/usr/bin/bthelper %k":' ${D}${sysconfdir}/udev/rules.d/90-pi-bluetooth.rules fi } -FILES_${PN} = "\ +FILES:${PN} = "\ ${bindir} \ ${sysconfdir} \ ${systemd_unitdir}/system \ " -RDEPENDS_${PN} += " \ +RDEPENDS:${PN} += " \ udev-rules-rpi \ " |