From: "Guillermo Rodríguez" <guille.rodriguez@gmail.com>
To: ptxdist@pengutronix.de
Cc: "Guillermo Rodríguez" <guille.rodriguez@gmail.com>
Subject: [ptxdist] [PATCH] weston: Add init script
Date: Thu, 12 Dec 2019 13:54:57 +0100 [thread overview]
Message-ID: <20191212125457.26860-1-guille.rodriguez@gmail.com> (raw)
Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
---
projectroot/etc/init.d/weston-init | 29 +++++++++++++++++++++++++++++
rules/weston.make | 4 ++++
2 files changed, 33 insertions(+)
create mode 100644 projectroot/etc/init.d/weston-init
diff --git a/projectroot/etc/init.d/weston-init b/projectroot/etc/init.d/weston-init
new file mode 100644
index 000000000..fa6b96b07
--- /dev/null
+++ b/projectroot/etc/init.d/weston-init
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+start() {
+ OPENVT_ARGS="-c 1 -s"
+ WESTON_ARGS="--log=/var/log/weston.log"
+
+ test -f /etc/default/weston-init && . /etc/default/weston-init
+
+ if [ -z "$XDG_RUNTIME_DIR" ]; then
+ export XDG_RUNTIME_DIR=/run/xdg
+ mkdir -p "$XDG_RUNTIME_DIR"
+ chmod 0700 "$XDG_RUNTIME_DIR"
+ fi
+
+ echo "Starting Weston"
+ exec openvt $OPENVT_ARGS -- weston $WESTON_ARGS
+}
+
+stop() {
+ echo "Stopping Weston"
+ killall -q weston
+}
+
+case $1 in
+ start|stop) $1 ;;
+ restart) stop ; sleep 1 ; start ;;
+
+ *) echo "Usage: $0 {start|stop|restart}"; exit 1 ;;
+esac
diff --git a/rules/weston.make b/rules/weston.make
index 4c38fd2d1..406b0fd48 100644
--- a/rules/weston.make
+++ b/rules/weston.make
@@ -170,6 +170,10 @@ endif
ifdef PTXCONF_WESTON_SYSTEMD
@$(call install_lib, weston, 0, 0, 0644, weston/systemd-notify)
endif
+ifdef PTXCONF_INITMETHOD_BBINIT
+ @$(call install_alternative, weston, 0, 0, 0755, /etc/init.d/weston-init)
+ @$(call install_link, weston, ../init.d/weston-init, /etc/rc.d/S92weston-init)
+endif
@$(call install_copy, weston, 0, 0, 0755, -, /usr/libexec/weston-simple-im)
@$(call install_copy, weston, 0, 0, 0755, -, /usr/libexec/weston-desktop-shell)
--
2.21.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
next reply other threads:[~2019-12-12 12:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 12:54 Guillermo Rodríguez [this message]
2020-01-06 11:18 ` Michael Olbrich
2020-01-07 10:08 ` Guillermo Rodriguez Garcia
2020-01-07 15:28 ` [ptxdist] [PATCH v2] " Guillermo Rodríguez
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=20191212125457.26860-1-guille.rodriguez@gmail.com \
--to=guille.rodriguez@gmail.com \
--cc=ptxdist@pengutronix.de \
/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