]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(bluetooth): include it if Appearance matches the value assigned for keyboard
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 9 May 2023 12:24:57 +0000 (14:24 +0200)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 26 Jun 2023 07:32:39 +0000 (09:32 +0200)
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/

modules.d/62bluetooth/module-setup.sh

index 460a057cde73bad286e2a0637783a04070c3d7f8..d7b3046f6f6ed001609dd59e1ef1c0afa66f6848 100755 (executable)
@@ -11,7 +11,8 @@ check() {
         # 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