bluez5: add bluetooth-init.service
This service acts as a systemd replacement for our bluetooth-init initscript. All it does is call the initscript before starting the bluetooth stack. Since initscripts dissapear from /etc/init.d when disabling sysvinit, move the script to /etc/. Also, include bluez5-init as a packagegroup-dey-bluetooth dependency regardles of whether systemd is enabled or not. https://jira.digi.com/browse/DEL-6415 Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
parent
dbd68f87d5
commit
ae1dfa5901
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Initialization of the bluetooth chip
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/etc/bluetooth-init start
|
||||||
|
ExecStop=/etc/bluetooth-init stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
RequiredBy=bluetooth.service
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Initialization of the bluetooth chip
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/etc/bluetooth-init start
|
||||||
|
ExecStop=/etc/bluetooth-init stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
RequiredBy=bluetooth.service
|
||||||
|
|
@ -4,6 +4,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
|
||||||
|
|
||||||
SRC_URI += " \
|
SRC_URI += " \
|
||||||
file://bluetooth-init \
|
file://bluetooth-init \
|
||||||
|
file://bluetooth-init.service \
|
||||||
file://main.conf \
|
file://main.conf \
|
||||||
file://0001-hcitool-do-not-show-unsupported-refresh-option.patch \
|
file://0001-hcitool-do-not-show-unsupported-refresh-option.patch \
|
||||||
file://0002-hcitool-increase-the-shown-connection-limit-to-20.patch \
|
file://0002-hcitool-increase-the-shown-connection-limit-to-20.patch \
|
||||||
|
|
@ -35,7 +36,10 @@ PACKAGECONFIG_append = " experimental"
|
||||||
|
|
||||||
do_install_append() {
|
do_install_append() {
|
||||||
install -d ${D}${sysconfdir}/init.d/
|
install -d ${D}${sysconfdir}/init.d/
|
||||||
install -m 0755 ${WORKDIR}/bluetooth-init ${D}${sysconfdir}/init.d/bluetooth-init
|
install -m 0755 ${WORKDIR}/bluetooth-init ${D}${sysconfdir}/bluetooth-init
|
||||||
|
ln -sf /etc/bluetooth-init ${D}${sysconfdir}/init.d/bluetooth-init
|
||||||
|
install -d ${D}${systemd_unitdir}/system/
|
||||||
|
install -m 0644 ${WORKDIR}/bluetooth-init.service ${D}${systemd_unitdir}/system/bluetooth-init.service
|
||||||
install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/bluetooth/
|
install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/bluetooth/
|
||||||
if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'experimental', 'experimental', '', d)}" ]; then
|
if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'experimental', 'experimental', '', d)}" ]; then
|
||||||
sed -i '/^SSD_OPTIONS/a SSD_OPTIONS="${SSD_OPTIONS} --experimental"' ${D}${INIT_D_DIR}/bluetooth
|
sed -i '/^SSD_OPTIONS/a SSD_OPTIONS="${SSD_OPTIONS} --experimental"' ${D}${INIT_D_DIR}/bluetooth
|
||||||
|
|
@ -45,10 +49,15 @@ do_install_append() {
|
||||||
PACKAGES =+ "${PN}-init"
|
PACKAGES =+ "${PN}-init"
|
||||||
|
|
||||||
FILES_${PN} += " ${sysconfdir}/bluetooth/main.conf"
|
FILES_${PN} += " ${sysconfdir}/bluetooth/main.conf"
|
||||||
FILES_${PN}-init = "${sysconfdir}/init.d/bluetooth-init"
|
FILES_${PN}-init = " ${sysconfdir}/bluetooth-init \
|
||||||
|
${sysconfdir}/init.d/bluetooth-init \
|
||||||
|
${systemd_unitdir}/system/bluetooth-init.service \
|
||||||
|
"
|
||||||
|
|
||||||
INITSCRIPT_PACKAGES += "${PN}-init"
|
INITSCRIPT_PACKAGES += "${PN}-init"
|
||||||
INITSCRIPT_NAME_${PN}-init = "bluetooth-init"
|
INITSCRIPT_NAME_${PN}-init = "bluetooth-init"
|
||||||
INITSCRIPT_PARAMS_${PN}-init = "start 19 2 3 4 5 . stop 21 0 1 6 ."
|
INITSCRIPT_PARAMS_${PN}-init = "start 19 2 3 4 5 . stop 21 0 1 6 ."
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE_${PN}-init = "bluetooth-init.service"
|
||||||
|
|
||||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
|
||||||
|
|
||||||
SRC_URI += " \
|
SRC_URI += " \
|
||||||
file://bluetooth-init \
|
file://bluetooth-init \
|
||||||
|
file://bluetooth-init.service \
|
||||||
file://main.conf \
|
file://main.conf \
|
||||||
file://0001-hcitool-do-not-show-unsupported-refresh-option.patch \
|
file://0001-hcitool-do-not-show-unsupported-refresh-option.patch \
|
||||||
file://0002-hcitool-increase-the-shown-connection-limit-to-20.patch \
|
file://0002-hcitool-increase-the-shown-connection-limit-to-20.patch \
|
||||||
|
|
@ -25,7 +26,10 @@ inherit update-rc.d
|
||||||
|
|
||||||
do_install_append() {
|
do_install_append() {
|
||||||
install -d ${D}${sysconfdir}/init.d/
|
install -d ${D}${sysconfdir}/init.d/
|
||||||
install -m 0755 ${WORKDIR}/bluetooth-init ${D}${sysconfdir}/init.d/bluetooth-init
|
install -m 0755 ${WORKDIR}/bluetooth-init ${D}${sysconfdir}/bluetooth-init
|
||||||
|
ln -sf /etc/bluetooth-init ${D}${sysconfdir}/init.d/bluetooth-init
|
||||||
|
install -d ${D}${systemd_unitdir}/system/
|
||||||
|
install -m 0644 ${WORKDIR}/bluetooth-init.service ${D}${systemd_unitdir}/system/bluetooth-init.service
|
||||||
install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/bluetooth/
|
install -m 0644 ${WORKDIR}/main.conf ${D}${sysconfdir}/bluetooth/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,10 +40,15 @@ PACKAGECONFIG_append = " health-profiles \
|
||||||
"
|
"
|
||||||
|
|
||||||
FILES_${PN} += " ${sysconfdir}/bluetooth/main.conf"
|
FILES_${PN} += " ${sysconfdir}/bluetooth/main.conf"
|
||||||
FILES_${PN}-init = "${sysconfdir}/init.d/bluetooth-init"
|
FILES_${PN}-init = " ${sysconfdir}/bluetooth-init \
|
||||||
|
${sysconfdir}/init.d/bluetooth-init \
|
||||||
|
${systemd_unitdir}/system/bluetooth-init.service \
|
||||||
|
"
|
||||||
|
|
||||||
INITSCRIPT_PACKAGES += "${PN}-init"
|
INITSCRIPT_PACKAGES += "${PN}-init"
|
||||||
INITSCRIPT_NAME_${PN}-init = "bluetooth-init"
|
INITSCRIPT_NAME_${PN}-init = "bluetooth-init"
|
||||||
INITSCRIPT_PARAMS_${PN}-init = "start 19 2 3 4 5 . stop 21 0 1 6 ."
|
INITSCRIPT_PARAMS_${PN}-init = "start 19 2 3 4 5 . stop 21 0 1 6 ."
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE_${PN}-init = "bluetooth-init.service"
|
||||||
|
|
||||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue