bluez5-init: unify all bluetooth-init services

Unify all the different bluetooth init scripts.
The service can be started as oneshot instead of forking, as in all cases
the attach command is started daemonized in background.
Regarding the service requirements, just rely on udev so the HW itself
should be detected and ready.
Make it running before the bluetooth service, so the HW Bluetooth device
is fully ready when bluetooth service starts.

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2025-02-03 12:55:54 +01:00
parent 2514406b4c
commit b5465a7390
3 changed files with 3 additions and 27 deletions

View File

@ -1,10 +1,12 @@
[Unit] [Unit]
Description=Initialization of the bluetooth chip Description=Initialization of the bluetooth chip
ConditionPathIsDirectory=/proc/device-tree/bluetooth ConditionPathIsDirectory=/proc/device-tree/bluetooth
After=systemd-udev-settle.service
Before=bluetooth.service Before=bluetooth.service
[Service] [Service]
Type=forking Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/bluetooth-init start ExecStart=/etc/bluetooth-init start
ExecStop=/etc/bluetooth-init stop ExecStop=/etc/bluetooth-init stop

View File

@ -1,14 +0,0 @@
[Unit]
Description=Initialization of the IW612 bluetooth chip
ConditionPathIsDirectory=/proc/device-tree/bluetooth
After=systemd-udev-settle.service
Before=bluetooth.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/bluetooth-init start
ExecStop=/etc/bluetooth-init stop
[Install]
WantedBy=bluetooth.service

View File

@ -1,12 +0,0 @@
[Unit]
Description=CYW55512 Bluetooth Initialization
After=network.target suspend.target
ConditionPathIsDirectory=/proc/device-tree/bluetooth
[Service]
ExecStart=/etc/bluetooth-init start
ExecStop=/etc/bluetooth-init stop
Type=forking
[Install]
WantedBy=multi-user.target suspend.target