meta-arago.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Denys Dmytriyenko <denis@denix.org>
To: meta-arago@lists.yoctoproject.org
Cc: Denys Dmytriyenko <denys@konsulko.com>
Subject: [master/kirkstone][PATCH 1/2] bt-enable: unbreak initscript
Date: Fri,  1 Dec 2023 15:44:26 -0500	[thread overview]
Message-ID: <20231201204427.19192-1-denis@denix.org> (raw)

From: Denys Dmytriyenko <denys@konsulko.com>

This was using a SysVinit initscript that was also called from a systemd
unit file when systemd-compat-units were enabled. With systemd and
SysVinit now fully separated in Arago, adjust initscripts accordingly to
work for both init managers.

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 .../recipes-connectivity/bt-enable/bt-enable.bb  | 16 +++++++++++-----
 .../bt-enable/bt-enable/bt-enable.service        |  4 ++--
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable.bb b/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable.bb
index 9759e688..cb7fa93f 100644
--- a/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable.bb
+++ b/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable.bb
@@ -21,9 +21,15 @@ SYSTEMD_SERVICE:${PN} = "bt-enable.service"
 RDEPENDS:${PN} += "bash"
 
 do_install () {
-	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 bt-enable.sh ${D}${sysconfdir}/init.d/
-
-	install -d ${D}${systemd_system_unitdir}
-	install -m0644 bt-enable.service ${D}${systemd_system_unitdir}
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		install -m 0755 bt-enable.sh ${D}${sysconfdir}/init.d/
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${bindir}
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0755 bt-enable.sh ${D}${bindir}
+		install -m 0644 bt-enable.service ${D}${systemd_system_unitdir}
+	fi
 }
diff --git a/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable/bt-enable.service b/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable/bt-enable.service
index 2bde23ad..9ba631a7 100644
--- a/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable/bt-enable.service
+++ b/meta-arago-distro/recipes-connectivity/bt-enable/bt-enable/bt-enable.service
@@ -4,8 +4,8 @@ After=network.target
 
 [Service]
 Type=oneshot
-ExecStart=/etc/init.d/bt-enable.sh
-WorkingDirectory=/etc/init.d
+ExecStart=/usr/bin/bt-enable.sh
+WorkingDirectory=/usr/bin
 StandardOutput=syslog
 
 [Install]
-- 
2.35.3



             reply	other threads:[~2023-12-01 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 20:44 Denys Dmytriyenko [this message]
2023-12-01 20:44 ` [master/kirkstone][PATCH 2/2] arago-gpl-notice: unbreak initscript Denys Dmytriyenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231201204427.19192-1-denis@denix.org \
    --to=denis@denix.org \
    --cc=denys@konsulko.com \
    --cc=meta-arago@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).