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.
- The hook does not work together with the
systemd
hook in/etc/mkinitcpio.conf
- For this hook to operate, the following packages are required:
dbus, bluez, bluez-utils
- It relies on the
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.
- If you haven't already, make sure you have paired, connected and trusted your bluetooth keyboard. Instructions can be found on the ArchWiki here.
- Ensure both your bluetooth keyboard and your system startup process are operational without issues at this point
- Check that
AutoEnable
is enabled in/etc/bluetooth/main.conf
-
Download or clone this repository to your machine and change into it
-
Run
makepkg
to install this hook -
Add
bluetooth
to your HOOKS array in/etc/mkinitcpio.conf
beforeencrypt
and afterkeyboard
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)
-
Rebuild your initramfs with
mkinitcpio
-
Upon next reboot, your keyboard should become operational automatically just before cryptsetup asks for your passphrase
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