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 a Peripheral (0x500) is found of minor class:
13 # * Keyboard/pointing (0xC0)
14 # and if Appearance is set to the value defined for keyboard (0x03C1)
15 grep -qiE -e 'Class=0x[0-9a-f]{3}5[4c]0' -e 'Appearance=0x03c1' /var
/lib
/bluetooth
/*/*/info
2> /dev
/null \
16 && dwarn
"If you need to use bluetooth, please include it explicitly."
22 # Module dependency requirements.
24 # This module has external dependencies on the systemd and dbus modules.
26 # Return 0 to include the dependent modules in the initramfs.
31 instmods bluetooth btrtl btintel btbcm bnep ath3k btusb rfcomm hidp
33 /lib
/firmware
/ar3k
/AthrBT
* \
34 /lib
/firmware
/ar3k
/ramps
* \
35 /lib
/firmware
/ath3k-1.fw
* \
36 /lib
/firmware
/BCM2033-MD.hex
* \
37 /lib
/firmware
/bfubase.frm
* \
38 /lib
/firmware
/BT3CPCC.bin
* \
39 /lib
/firmware
/brcm
/*.hcd
* \
40 /lib
/firmware
/mediatek
/mt7622pr2h.bin
* \
41 /lib
/firmware
/qca
/nvm
* \
42 /lib
/firmware
/qca
/crnv
* \
43 /lib
/firmware
/qca
/rampatch
* \
44 /lib
/firmware
/qca
/crbtfw
* \
45 /lib
/firmware
/rtl_bt
/* \
46 /lib
/firmware
/intel
/ibt
* \
47 /lib
/firmware
/ti-connectivity
/TIInit_
* \
48 /lib
/firmware
/nokia
/bcmfw.bin
* \
49 /lib
/firmware
/nokia
/ti1273.bin
*
52 # Install the required file(s) for the module in the initramfs.
54 # shellcheck disable=SC2064
55 trap "$(shopt -p globstar)" RETURN
57 local -a var_lib_files
60 "$dbussystem"/bluetooth.conf \
61 "$dbussystemservices"/org.bluez.service \
62 "${systemdsystemunitdir}/bluetooth.target" \
63 "${systemdsystemunitdir}/bluetooth.service" \
67 /usr
/libexec
/bluetooth
/bluetoothd \
68 /usr
/lib
/bluetooth
/bluetoothd
70 if [[ $hostonly ]]; then
71 var_lib_files
=("$dracutsysrootdir"/var
/lib
/bluetooth
/**)
74 /etc
/bluetooth
/main.conf \
75 "$dbussystemconfdir"/bluetooth.conf \
76 "$systemdsystemconfdir"/bluetooth.service \
77 "$systemdsystemconfdir/bluetooth.service.d/*.conf" \
78 "${var_lib_files[@]#"$dracutsysrootdir"}"
81 inst_rules
69-btattach-bcm.rules
60-persistent-input.rules
83 # shellcheck disable=SC1004
85 '/^\[Unit\]/aDefaultDependencies=no\
86 Conflicts=shutdown.target\
87 Before=shutdown.target\
89 "${initdir}/${systemdsystemunitdir}/bluetooth.service"
91 $SYSTEMCTL -q --root "$initdir" enable bluetooth.service