mkinitcpio hook to enable bluetooth connectivity during boot.
This hook has been set up to be used with mkinitcpio and has been tested solely on an Arch Linux x86_64 installation that uses refind-efi instead of GRUB.
systemd
hook in /etc/mkinitcpio.conf
dbus, bluez, bluez-utils
AutoEnable=true
setting in /etc/bluetooth/main.conf
Please be aware that just like any other additional module, the hook adds to your kernel image. To operate, it hence requires your kernel to be available during boot, before you are asked for a passphrase. A supported setup therefore strictly requires your /boot partition to not be encrypted.
If you are a Manjaro user and installed your system using their setup assistant, there is a high likelyhood of your /boot partition also being encrypted. In that case this hook won't work for you as you are prompted by GRUB early on, before your kernel and hence this module is available. Please refer to this Manjaro post for options to make your boot process support this hook.
AutoEnable
is enabled in /etc/bluetooth/main.conf
makepkg
to install this hookAdd bluetooth
to your HOOKS array in /etc/mkinitcpio.conf
before encrypt
and after keyboard
Example: HOOKS=(base udev autodetect modconf keyboard keymap bluetooth block encrypt lvm2 filesystems fsck)
(if needed) Add any file, binary, module that your keyboard or bt adapter might need
Example:
FILES=(/usr/lib/firmware/intel/ibt-20-1-3.sfi)
MODULES=(usbhid xhci_hcd)
mkinitcpio
If you have trouble finding what module, file, binary you need for your keyboard or bt adapter, try looking for errors in dmesg and journalctl related to bluetooth.
Example:
# journactl | grep bluetooth
kernel: bluetooth hci0: Direct firmware load for intel/ibt-20-1-3.sfi failed with error -2
# dmesg | grep bluetooth
[ 1.717123] bluetooth hci0: Direct firmware load for intel/ibt-20-1-3.sfi failed with error -2