]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(bluetooth): make bluetooth rules more strict
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Fri, 24 Feb 2023 17:12:44 +0000 (17:12 +0000)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 26 Jun 2023 07:32:39 +0000 (09:32 +0200)
Only warn if bluetooth kernel module is loaded
at the time of initrd generation in hostonly mode.

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

index 8be318364523181b49bb335fba3714e51154e353..8bef9272c12e7963b324f5ed0f5f9c607a0ab53c 100755 (executable)
@@ -8,11 +8,12 @@ check() {
     require_any_binary /usr/lib/bluetooth/bluetoothd /usr/libexec/bluetooth/bluetoothd || return 1
 
     if [[ $hostonly ]]; then
-        # Warn user if a Peripheral (0x500) is found of minor class:
+        # Warn user if bluetooth kernel module is loaded
+        # and if Peripheral (0x500) is found of minor class:
         #  * Keyboard (0x40)
         #  * Keyboard/pointing (0xC0)
         # 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 \
+        [ -d "/sys/class/bluetooth" ] && 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