meta-arago.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Sai Sree Kartheek Adivi <s-adivi@ti.com>
To: <meta-arago@lists.yoctoproject.org>, <praneeth@ti.com>,
	<denis@denix.org>, <reatmon@ti.com>, <c-shilwant@ti.com>,
	<a-limaye@ti.com>
Cc: <g-gupta@ti.com>, <khasim@ti.com>, <p-bhagat@ti.com>
Subject: [meta-arago][kirkstone][PATCH v2] matrix-gui: handle systemd and sysvinit scripts separately
Date: Wed, 25 Oct 2023 19:03:51 +0530	[thread overview]
Message-ID: <20231025133351.3043121-1-s-adivi@ti.com> (raw)

- Install systemd service file or init script based on the distro_features
systemd/sysvinit.
- systemd service also needs to depend on lighttpd service so that matrix
won't start before the webserver.

Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
---
v2: Handle both sysvinit and systemd

 .../matrix/matrix-gui/matrix-gui-2.0.service      |  4 ++--
 .../recipes-core/matrix/matrix-gui_2.0.bb         | 15 +++++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
index 40a8f0f9..462803f3 100644
--- a/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
+++ b/meta-arago-demos/recipes-core/matrix/matrix-gui/matrix-gui-2.0.service
@@ -1,6 +1,6 @@
 [Unit]
 Description=Matrix GUI
-After=weston.service
+After=weston.service lighttpd.service
 Requires=weston.service
 Before=graphical.target
 
@@ -12,7 +12,7 @@ IgnoreSIGPIPE=no
 KillMode=process
 GuessMainPID=no
 RemainAfterExit=yes
-ExecStart=/etc/init.d/matrix-gui-2.0 start
+ExecStart=/usr/share/matrix-gui-2.0/matrix-gui-2.0 start
 
 [Install]
 WantedBy=multi-user.target
diff --git a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
index 9299a929..508edb9b 100644
--- a/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
+++ b/meta-arago-demos/recipes-core/matrix/matrix-gui_2.0.bb
@@ -50,12 +50,15 @@ do_install(){
 	sed -i -e "s/__SWITCH_FOREGROUND_VT__/${SWITCH_FOREGROUND_VT}/" ${WORKDIR}/${MATRIX_INITSCRIPT}
 
 	# Install the script
-	install -d ${D}${sysconfdir}/init.d
-	install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${sysconfdir}/init.d/matrix-gui-2.0
-
-	# Install the systemd unit file
-	install -d ${D}${systemd_system_unitdir}
-	install -m 0644 ${WORKDIR}/matrix-gui-2.0.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 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${sysconfdir}/init.d/matrix-gui-2.0
+	fi
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${systemd_system_unitdir}
+		install -m 0644 ${WORKDIR}/matrix-gui-2.0.service ${D}${systemd_system_unitdir}
+		install -m 0755 ${WORKDIR}/${MATRIX_INITSCRIPT} ${D}${MATRIX_BASE_DIR}/matrix-gui-2.0
+	fi
 }
 
 GUIDEPS = "${@bb.utils.contains('DISTRO_FEATURES','opengl',"matrix-gui-browser refresh-screen",'',d)}"
-- 
2.34.1



             reply	other threads:[~2023-10-25 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 13:33 Sai Sree Kartheek Adivi [this message]
2023-11-08 13:15 ` [meta-arago][kirkstone][PATCH v2] matrix-gui: handle systemd and sysvinit scripts separately Sinthu Raja M

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=20231025133351.3043121-1-s-adivi@ti.com \
    --to=s-adivi@ti.com \
    --cc=a-limaye@ti.com \
    --cc=c-shilwant@ti.com \
    --cc=denis@denix.org \
    --cc=g-gupta@ti.com \
    --cc=khasim@ti.com \
    --cc=meta-arago@lists.yoctoproject.org \
    --cc=p-bhagat@ti.com \
    --cc=praneeth@ti.com \
    --cc=reatmon@ti.com \
    /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).