Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bluetooth): implement bluetooth support in initrd #1139

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

bgmilne
Copy link

@bgmilne bgmilne commented Mar 1, 2021

This pull request changes...

Changes

  • Included a bluetooth module that installs modules, firmware, udev rules and bluetoothd.
  • systemd and dbus are required by bluetoothd
  • Include bluetooth by default if BT keyboard or combo found

Checklist

  • I have tested it locally
    For me, this PR improves on Implemented bluetooth support in initrd. #544 in that I can now use Bluetooth keyboards:
    • To enter the LUKS passphrase for my root filesystem
    • in an rd.break boot (e.g. to also enter my root password the emergency shell prompt).
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Fixes #270

@github-actions github-actions bot added modules Issue tracker for all modules needs review labels Mar 1, 2021
@johannbg
Copy link
Collaborator

johannbg commented Mar 1, 2021

Please change this PR to a draft. That your own connection fails in your own testing and "others can get it to go a bit further" makes it obviously an incomplete PR...

@bgmilne bgmilne marked this pull request as draft March 1, 2021 18:26
@bgmilne bgmilne mentioned this pull request Mar 1, 2021
Copy link
Collaborator

@johannbg johannbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did some pre-review, Start by fixing these issues also change your commit msg to feat(bluetooth): implement bluetooth support in initrd so it passes the commisery check.

modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
@bgmilne bgmilne force-pushed the master branch 2 times, most recently from 260cf52 to 577a732 Compare March 7, 2021 16:32
@bgmilne bgmilne changed the title Implemented bluetooth support in initrd. feat(bluetooth): implement bluetooth support in initrd Mar 7, 2021
@bgmilne bgmilne marked this pull request as ready for review March 8, 2021 16:57
danimo
danimo previously requested changes Mar 10, 2021
modules.d/62bluetooth/module-setup.sh Outdated Show resolved Hide resolved
@bgmilne bgmilne force-pushed the master branch 4 times, most recently from 1ed4023 to 9458e4d Compare March 14, 2021 19:56
- Included a bluetooth module that installs modules, firmware, udev rules and bluetoothd.
- systemd and dbus are required by bluetoothd
- Include bluetooth by default if BT keyboard or combo found
@bgmilne
Copy link
Author

bgmilne commented Mar 21, 2021

This module is working reliably for me.

Is there anything else blocking this from being merged (the only failed test seems unrelated)?

@bgmilne bgmilne requested a review from johannbg March 27, 2021 10:15
@haraldh haraldh enabled auto-merge (rebase) April 16, 2021 14:00
@johannbg johannbg disabled auto-merge April 16, 2021 14:39
@johannbg johannbg enabled auto-merge (rebase) April 16, 2021 14:41
@johannbg johannbg dismissed danimo’s stale review April 16, 2021 18:43

I'm dismissing this review because the issue in the review have been addressed and github is blocking the merge

@johannbg johannbg merged commit 64ee2a5 into dracutdevs:master Apr 16, 2021
@tunix
Copy link

tunix commented Mar 6, 2022

Hi! I've Fedora Silverblue 35 running on my computer and have the latest updates installed. I tried to enable bluetooth module by adding a file like this:

# cat /etc/dracut.conf.d/ble.conf
add_dracutmodules+=" bluetooth "

And then tried to regenerate initramfs with the following command:

dracut --regenerate-all --force

I can see the bluetooth related files inside initramfs including the files that are probably needed for my keyboard:

# lsinitrd initramfs-5.16.12-200.fc35.x86_64.img |grep bluetooth
bluetooth
drwxr-xr-x   1 root     root            0 Jan  1  1970 etc/bluetooth
-rw-r--r--   1 root     root        10841 Jan  1  1970 etc/bluetooth/main.conf
-rw-r--r--   1 root     root         1182 Jan  1  1970 etc/dbus-1/system.d/bluetooth.conf
drwxr-xr-x   1 root     root            0 Jan  1  1970 etc/systemd/system/bluetooth.target.wants
lrwxrwxrwx   1 root     root           41 Jan  1  1970 etc/systemd/system/bluetooth.target.wants/bluetooth.service -> /usr/lib/systemd/system/bluetooth.service
lrwxrwxrwx   1 root     root           41 Jan  1  1970 etc/systemd/system/dbus-org.bluez.service -> /usr/lib/systemd/system/bluetooth.service
-rwxr-xr-x   1 root     root       288200 Jan  1  1970 usr/bin/bluetoothctl
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/libexec/bluetooth
-rwxr-xr-x   1 root     root      1241576 Jan  1  1970 usr/libexec/bluetooth/bluetoothd
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth
-rw-r--r--   1 root     root        26680 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btbcm.ko.xz
-rw-r--r--   1 root     root        36504 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btintel.ko.xz
-rw-r--r--   1 root     root        29044 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btrtl.ko.xz
-rw-r--r--   1 root     root        46788 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btusb.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth
-rw-r--r--   1 root     root       281012 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/bluetooth.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/bnep
-rw-r--r--   1 root     root        33300 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/bnep/bnep.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/hidp
-rw-r--r--   1 root     root        37252 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/hidp/hidp.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/rfcomm
-rw-r--r--   1 root     root        61760 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/rfcomm/rfcomm.ko.xz
-rw-r--r--   1 root     root          822 Jan  1  1970 usr/lib/systemd/system/bluetooth.service
-rw-r--r--   1 root     root          435 Jan  1  1970 usr/lib/systemd/system/bluetooth.target
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth/58:96:1D:2C:14:4B
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth/58:96:1D:2C:14:4B/34:88:5D:A3:D1:A7
-rw-------   1 root     root          367 Jan  1  1970 var/lib/bluetooth/58:96:1D:2C:14:4B/34:88:5D:A3:D1:A7/info
....
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth/mesh

But when I reboot my computer, it doesn't get paired with the keyboard at LUKS prompt so I can't type my encryption password in. Am I doing something wrong? Do I need to do additional stuff?

@Ramen-LadyHKG
Copy link

Hi! I've Fedora Silverblue 35 running on my computer and have the latest updates installed. I tried to enable bluetooth module by adding a file like this:

# cat /etc/dracut.conf.d/ble.conf
add_dracutmodules+=" bluetooth "

And then tried to regenerate initramfs with the following command:

dracut --regenerate-all --force

I can see the bluetooth related files inside initramfs including the files that are probably needed for my keyboard:

# lsinitrd initramfs-5.16.12-200.fc35.x86_64.img |grep bluetooth
bluetooth
drwxr-xr-x   1 root     root            0 Jan  1  1970 etc/bluetooth
-rw-r--r--   1 root     root        10841 Jan  1  1970 etc/bluetooth/main.conf
-rw-r--r--   1 root     root         1182 Jan  1  1970 etc/dbus-1/system.d/bluetooth.conf
drwxr-xr-x   1 root     root            0 Jan  1  1970 etc/systemd/system/bluetooth.target.wants
lrwxrwxrwx   1 root     root           41 Jan  1  1970 etc/systemd/system/bluetooth.target.wants/bluetooth.service -> /usr/lib/systemd/system/bluetooth.service
lrwxrwxrwx   1 root     root           41 Jan  1  1970 etc/systemd/system/dbus-org.bluez.service -> /usr/lib/systemd/system/bluetooth.service
-rwxr-xr-x   1 root     root       288200 Jan  1  1970 usr/bin/bluetoothctl
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/libexec/bluetooth
-rwxr-xr-x   1 root     root      1241576 Jan  1  1970 usr/libexec/bluetooth/bluetoothd
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth
-rw-r--r--   1 root     root        26680 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btbcm.ko.xz
-rw-r--r--   1 root     root        36504 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btintel.ko.xz
-rw-r--r--   1 root     root        29044 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btrtl.ko.xz
-rw-r--r--   1 root     root        46788 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/drivers/bluetooth/btusb.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth
-rw-r--r--   1 root     root       281012 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/bluetooth.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/bnep
-rw-r--r--   1 root     root        33300 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/bnep/bnep.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/hidp
-rw-r--r--   1 root     root        37252 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/hidp/hidp.ko.xz
drwxr-xr-x   1 root     root            0 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/rfcomm
-rw-r--r--   1 root     root        61760 Jan  1  1970 usr/lib/modules/5.16.12-200.fc35.x86_64/kernel/net/bluetooth/rfcomm/rfcomm.ko.xz
-rw-r--r--   1 root     root          822 Jan  1  1970 usr/lib/systemd/system/bluetooth.service
-rw-r--r--   1 root     root          435 Jan  1  1970 usr/lib/systemd/system/bluetooth.target
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth/58:96:1D:2C:14:4B
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth/58:96:1D:2C:14:4B/34:88:5D:A3:D1:A7
-rw-------   1 root     root          367 Jan  1  1970 var/lib/bluetooth/58:96:1D:2C:14:4B/34:88:5D:A3:D1:A7/info
....
drwxr-xr-x   1 root     root            0 Jan  1  1970 var/lib/bluetooth/mesh

But when I reboot my computer, it doesn't get paired with the keyboard at LUKS prompt so I can't type my encryption password in. Am I doing something wrong? Do I need to do additional stuff?

would like to know as well

running fedora kernel 6.9.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules Issue tracker for all modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bluetooth module
7 participants