From: Laszlo Gombos Date: Fri, 24 Feb 2023 17:12:44 +0000 (+0000) Subject: fix(bluetooth): make bluetooth rules more strict X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfa408c9de7cd0b0af6099b6f1e0cce2e70ec467;p=thirdparty%2Fdracut.git fix(bluetooth): make bluetooth rules more strict Only warn if bluetooth kernel module is loaded at the time of initrd generation in hostonly mode. --- diff --git a/modules.d/62bluetooth/module-setup.sh b/modules.d/62bluetooth/module-setup.sh index 8be318364..8bef9272c 100755 --- a/modules.d/62bluetooth/module-setup.sh +++ b/modules.d/62bluetooth/module-setup.sh @@ -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