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 # Include by default if a Peripheral (0x500) is found of minor class:
13 # * Keyboard/pointing (0xC0)
14 grep -qiE 'Class=0x[0-9a-f]{3}5[4c]0' /var
/lib
/bluetooth
/*/*/info
2> /dev
/null
&& return 0
20 # Module dependency requirements.
22 # This module has external dependencies on the systemd and dbus modules.
24 # Return 0 to include the dependent modules in the initramfs.
29 instmods bluetooth btrtl btintel btbcm bnep ath3k btusb rfcomm hidp
31 /usr
/lib
/firmware
/ar3k
/AthrBT
* \
32 /usr
/lib
/firmware
/ar3k
/ramps
* \
33 /usr
/lib
/firmware
/ath3k-1.fw \
34 /usr
/lib
/firmware
/BCM2033-MD.hex \
35 /usr
/lib
/firmware
/bfubase.frm \
36 /usr
/lib
/firmware
/BT3CPCC.bin \
37 /usr
/lib
/firmware
/brcm
/*.hcd \
38 /usr
/lib
/firmware
/mediatek
/mt7622pr2h.bin \
39 /usr
/lib
/firmware
/qca
/nvm
* \
40 /usr
/lib
/firmware
/qca
/crnv
* \
41 /usr
/lib
/firmware
/qca
/rampatch
* \
42 /usr
/lib
/firmware
/qca
/crbtfw
* \
43 /usr
/lib
/firmware
/rtl_bt
/* \
44 /usr
/lib
/firmware
/intel
/ibt
* \
45 /usr
/lib
/firmware
/ti-connectivity
/TIInit_
* \
46 /usr
/lib
/firmware
/nokia
/bcmfw.bin \
47 /usr
/lib
/firmware
/nokia
/ti1273.bin
51 # Install the required file(s) for the module in the initramfs.
53 # shellcheck disable=SC2064
54 trap "$(shopt -p nullglob globstar)" RETURN
55 shopt -q -s nullglob globstar
56 local -a var_lib_files
59 "${systemdsystemunitdir}/bluetooth.target" \
60 "${systemdsystemunitdir}/bluetooth.service" \
64 /usr
/libexec
/bluetooth
/bluetoothd \
65 /usr
/lib
/bluetooth
/bluetoothd
67 if [[ $hostonly ]]; then
68 var_lib_files
=("$dracutsysrootdir"/var
/lib
/bluetooth
/**)
71 /etc
/bluetooth
/main.conf \
72 /etc
/dbus-
1/system.d
/bluetooth.conf \
73 "${var_lib_files[@]#"$dracutsysrootdir"}"
76 inst_rules
69-btattach-bcm.rules
60-persistent-input.rules
78 # shellcheck disable=SC1004
80 '/^\[Unit\]/aDefaultDependencies=no\
81 Conflicts=shutdown.target\
82 Before=shutdown.target\
84 "${initdir}/${systemdsystemunitdir}/bluetooth.service"
86 $SYSTEMCTL -q --root "$initdir" enable bluetooth.service