Update bluetooth docs & add udev rules (#92)

* Update bluetooth docs

* add udev rules

* Add cmp to build

* Create bluetooth.md
This commit is contained in:
Pascal Vizeli
2018-07-10 10:11:58 +02:00
committed by GitHub
parent 7cffb1f45b
commit 5ce7331001
4 changed files with 40 additions and 3 deletions

View File

@@ -16,14 +16,17 @@ define BLUETOOTH_BCM43XX_BUILD_CMDS
endef
define BLUETOOTH_BCM43XX_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/etc/systemd/system/hassos-hardware.wants
mkdir -p $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants
cp -f $(@D)/bluetooth-bcm43xx $(TARGET_DIR)/usr/sbin/
cp -f $(@D)/bluetooth-bcm43xx.service $(TARGET_DIR)/usr/lib/systemd/system/
ln -fs /usr/lib/systemd/system/bluetooth-bcm43xx.service $(TARGET_DIR)/etc/systemd/system/hassos-hardware.wants/
ln -fs /usr/lib/systemd/system/bluetooth-bcm43xx.service $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants/
mkdir -p $(TARGET_DIR)/lib/firmware/brcm
cp -f $(@D)/BCM43430A1.hcd $(TARGET_DIR)/lib/firmware/brcm/
cp -f $(@D)/BCM4345C0.hcd $(TARGET_DIR)/lib/firmware/brcm/
mkdir -p $(TARGET_DIR)/etc/udev/rules.d
cp -f $(@D)/bluetooth-bcm43xx.rules $(TARGET_DIR)/etc/udev/rules.d/
endef
$(eval $(generic-package))

View File

@@ -0,0 +1,22 @@
KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
echo 0; \
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"