Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,40 @@
From a73bbed89fb049ac424c211629935b26013e2573 Mon Sep 17 00:00:00 2001
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: Inappropriate [OE-specific]
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
usr/bin/bthelper | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/usr/bin/bthelper b/usr/bin/bthelper
index 2133fbc..1fc9245 100755
--- a/usr/bin/bthelper
+++ b/usr/bin/bthelper
@@ -12,8 +12,8 @@ fi
dev=$1
# Need to bring hci up before looking at MAC as it can be all zeros during init
-/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
@@ -0,0 +1,57 @@
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;branch=master;protocol=https \
file://0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch \
"
SRCREV = "fd4775bf90e037551532fc214a958074830bb80d"
S = "${WORKDIR}/git"
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'update-rc.d', d)}
# hciuart.service replaces what was brcm43438.service
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
install -m 0644 ${S}/lib/udev/rules.d/* ${D}${sysconfdir}/udev/rules.d
install -d ${D}${bindir}
install -m 0755 ${S}/usr/bin/bthelper ${D}${bindir}
install -m 0755 ${S}/usr/bin/btuart ${D}${bindir}
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
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} = "\
${bindir} \
${sysconfdir} \
${systemd_unitdir}/system \
"
RDEPENDS:${PN} += " \
udev-rules-rpi \
"