From b5465a73900193e1f2c985fd869c18ab3fe00483 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Mon, 3 Feb 2025 12:55:54 +0100 Subject: [PATCH] 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 --- .../bluez/bluez5-init/bluetooth-init.service | 4 +++- .../bluez5-init/ccimx9/bluetooth-init.service | 14 -------------- .../stm32mpcommon/bluetooth-init.service | 12 ------------ 3 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx9/bluetooth-init.service delete mode 100644 meta-digi-dey/recipes-connectivity/bluez/bluez5-init/stm32mpcommon/bluetooth-init.service diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/bluetooth-init.service b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/bluetooth-init.service index 2e3e13d9e..df97793b0 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/bluetooth-init.service +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/bluetooth-init.service @@ -1,10 +1,12 @@ [Unit] Description=Initialization of the bluetooth chip ConditionPathIsDirectory=/proc/device-tree/bluetooth +After=systemd-udev-settle.service Before=bluetooth.service [Service] -Type=forking +Type=oneshot +RemainAfterExit=yes ExecStart=/etc/bluetooth-init start ExecStop=/etc/bluetooth-init stop diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx9/bluetooth-init.service b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx9/bluetooth-init.service deleted file mode 100644 index adc369562..000000000 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/ccimx9/bluetooth-init.service +++ /dev/null @@ -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 diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/stm32mpcommon/bluetooth-init.service b/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/stm32mpcommon/bluetooth-init.service deleted file mode 100644 index 9b79a78e5..000000000 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-init/stm32mpcommon/bluetooth-init.service +++ /dev/null @@ -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