Skip to content

Commit

Permalink
fix(bluetooth): make bluetooth rules more strict
Browse files Browse the repository at this point in the history
Only warn if bluetooth kernel module is loaded
at the time of initrd generation in hostonly mode.
  • Loading branch information
LaszloGombos authored and aafeijoo-suse committed Jun 26, 2023
1 parent e84d65c commit dfa408c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules.d/62bluetooth/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit dfa408c

Please sign in to comment.