Following the Bluetooth spec [1], Assigned Numbers Document, Rev. 2023-05-04,
Section 2.6.3, Appearance Sub-category, the Appearance value defined for
keyboards is 0x03C1.
This value must be checked to include the bluetooth module in hostonly mode,
because some Bluetooth keyboards do not set the Class attribute.
[1] https://www.bluetooth.com/specifications/assigned-numbers/
# Warn user if a Peripheral (0x500) is found of minor class:
# * Keyboard (0x40)
# * Keyboard/pointing (0xC0)
- grep -qiE 'Class=0x[0-9a-f]{3}5[4c]0' /var/lib/bluetooth/*/*/info 2> /dev/null \
+ # and if Appearance is set to the value defined for keyboard (0x03C1)
+ grep -qiE -e 'Class=0x[0-9a-f]{3}5[4c]0' -e 'Appearance=0x03c1' /var/lib/bluetooth/*/*/info 2> /dev/null \
&& dwarn "If you need to use bluetooth, please include it explicitly."
fi