diff --git a/Documentation/bluetooth.md b/Documentation/bluetooth.md new file mode 100644 index 000000000..a9bb3da04 --- /dev/null +++ b/Documentation/bluetooth.md @@ -0,0 +1,12 @@ +# Bluetooth + +We support `bluetoothctl` on host. Later we want also support bluetooth trought UI. +All pairs and settings are persistent over reboots and updates. + +If you want setup bluetooth on host, use the *bluetoothctl* utility. + +## Scan devices + +``` +[bluetooth]# scan on +``` diff --git a/buildroot-external/busybox.config b/buildroot-external/busybox.config index 6173e2ec8..f29ab87e6 100644 --- a/buildroot-external/busybox.config +++ b/buildroot-external/busybox.config @@ -398,7 +398,7 @@ CONFIG_SHOWKEY=y CONFIG_AWK=y CONFIG_FEATURE_AWK_LIBM=y CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y -# CONFIG_CMP is not set +CONFIG_CMP=y # CONFIG_DIFF is not set # CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set # CONFIG_FEATURE_DIFF_DIR is not set diff --git a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk index 6ec348349..a6976bca1 100644 --- a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk +++ b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.mk @@ -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)) diff --git a/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.rules b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.rules new file mode 100644 index 000000000..461fc1c84 --- /dev/null +++ b/buildroot-external/package/bluetooth-bcm43xx/bluetooth-bcm43xx.rules @@ -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" +