Remove kernel HCI driver if no WiFi/Bluetooth module present (#2944) (#2948)

* Remove kernel HCI driver if no WiFi/Bluetooth module present (#2944)

If the WiFi/Bluetooth module is not present on the SDIO bus, remove the
HCI driver. This avoids hci0 interface to be present. Current Home
Assistant Core versions show a Bluetooth device as soon as a hci device
is present. With this change there won't be a Bluetooth device shown.

* Update buildroot-external/package/pi-bluetooth/hcidisable.service

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>

---------

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
This commit is contained in:
Stefan Agner 2023-11-28 17:23:08 +01:00 committed by GitHub
parent 93a2d8a19b
commit 9235649bbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[Unit]
Description=Remove HCI kernel driver if WiFi/Bluetooth module is not present
ConditionPathExists=!/sys/bus/sdio/devices/mmc1:0001:1
[Service]
Type=forking
ExecStart=/usr/sbin/modprobe -r hci_uart
[Install]
WantedBy=hassos-hardware.target

View File

@ -12,6 +12,7 @@ PI_BLUETOOTH_LICENSE_FILES = debian/copyright
define PI_BLUETOOTH_INSTALL_TARGET_CMDS
$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants
$(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/hciuart.service $(TARGET_DIR)/usr/lib/systemd/system/
$(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/hcidisable.service $(TARGET_DIR)/usr/lib/systemd/system/
$(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/bthelper@.service $(TARGET_DIR)/usr/lib/systemd/system/
$(INSTALL) -d $(TARGET_DIR)/usr/bin