2 # This file is part of dracut.
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 # Prerequisite check(s) for module.
7 # If the binary(s) requirements are not fulfilled the module can't be installed
8 require_any_binary
/usr
/lib
/bluetooth
/bluetoothd
/usr
/libexec
/bluetooth
/bluetoothd ||
return 1
10 if [[ $hostonly ]]; then
11 # Warn user if bluetooth kernel module is loaded
12 # and if Peripheral (0x500) is found of minor class:
14 # * Keyboard/pointing (0xC0)
15 # and if Appearance is set to the value defined for keyboard (0x03C1)
16 [ -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 \
17 && dwarn
"If you need to use bluetooth, please include it explicitly."
23 # Module dependency requirements.
25 # This module has external dependencies on the systemd and dbus modules.
27 # Return 0 to include the dependent modules in the initramfs.
32 instmods bluetooth btrtl btintel btbcm bnep ath3k btusb rfcomm hidp
34 /lib
/firmware
/ar3k
/AthrBT
* \
35 /lib
/firmware
/ar3k
/ramps
* \
36 /lib
/firmware
/ath3k-1.fw
* \
37 /lib
/firmware
/BCM2033-MD.hex
* \
38 /lib
/firmware
/bfubase.frm
* \
39 /lib
/firmware
/BT3CPCC.bin
* \
40 /lib
/firmware
/brcm
/*.hcd
* \
41 /lib
/firmware
/mediatek
/mt7622pr2h.bin
* \
42 /lib
/firmware
/qca
/nvm
* \
43 /lib
/firmware
/qca
/crnv
* \
44 /lib
/firmware
/qca
/rampatch
* \
45 /lib
/firmware
/qca
/crbtfw
* \
46 /lib
/firmware
/rtl_bt
/* \
47 /lib
/firmware
/intel
/ibt
* \
48 /lib
/firmware
/ti-connectivity
/TIInit_
* \
49 /lib
/firmware
/nokia
/bcmfw.bin
* \
50 /lib
/firmware
/nokia
/ti1273.bin
*
53 # Install the required file(s) for the module in the initramfs.
55 # shellcheck disable=SC2064
56 trap "$(shopt -p globstar)" RETURN
58 local -a var_lib_files
61 "$dbussystem"/bluetooth.conf \
62 "$dbussystemservices"/org.bluez.service \
63 "${systemdsystemunitdir}/bluetooth.target" \
64 "${systemdsystemunitdir}/bluetooth.service" \
68 /usr
/libexec
/bluetooth
/bluetoothd \
69 /usr
/lib
/bluetooth
/bluetoothd
71 if [[ $hostonly ]]; then
72 var_lib_files
=("$dracutsysrootdir"/var
/lib
/bluetooth
/**)
75 /etc
/bluetooth
/main.conf \
76 "$dbussystemconfdir"/bluetooth.conf \
77 "$systemdsystemconfdir"/bluetooth.service \
78 "$systemdsystemconfdir/bluetooth.service.d/*.conf" \
79 "${var_lib_files[@]#"$dracutsysrootdir"}"
82 inst_rules
69-btattach-bcm.rules
60-persistent-input.rules
84 # shellcheck disable=SC1004
86 '/^\[Unit\]/aDefaultDependencies=no\
87 Conflicts=shutdown.target\
88 Before=shutdown.target\
90 "${initdir}/${systemdsystemunitdir}/bluetooth.service"
92 $SYSTEMCTL -q --root "$initdir" enable bluetooth.service