[oe-commits] [openembedded-core] 22/27: weston-init: Add module support for the weston-start helper

git at git.openembedded.org git at git.openembedded.org
Thu May 19 22:56:04 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 1512edcf1b5be3c7924bad9fee62bfc377906f34
Author: Otavio Salvador <otavio at ossystems.com.br>
AuthorDate: Wed May 18 13:40:45 2016 -0300

    weston-init: Add module support for the weston-start helper
    
    To make weston-start more flexible we now support module loading. For
    such modules, following functions can be used:
    
     - add_weston_argument
     - add_openvt_argument
    
    Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-graphics/wayland/weston-init.bb       |  3 +++
 .../wayland/weston-init/weston-start               | 26 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 3a2251e..e4e2701 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -11,7 +11,10 @@ S = "${WORKDIR}"
 do_install() {
 	install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
 	install -Dm0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
+
+	# Install weston-start script
 	install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
+	sed -i 's, at DATADIR@,${datadir},g' ${D}${bindir}/weston-start
 }
 
 inherit allarch update-rc.d distro_features_check systemd
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start
index dc2b1ef..4aa7c66 100755
--- a/meta/recipes-graphics/wayland/weston-init/weston-start
+++ b/meta/recipes-graphics/wayland/weston-init/weston-start
@@ -9,6 +9,19 @@ usage() {
 EOF
 }
 
+## Module support
+modules_dir=@DATADIR@/weston-start
+
+# Add weston extra argument
+add_weston_argument() {
+	weston_args="$weston_args $1"
+}
+
+# Add openvt extra argument
+add_openvt_argument() {
+	openvt_args="$openvt_args $1"
+}
+
 if test $# -lt 2; then
 	usage
 	exit 1
@@ -32,6 +45,19 @@ done
 
 weston_args=$*
 
+# Load and run modules
+if [ -d "$modules_dir" ]; then
+	for m in "$modules_dir"/*; do
+		# Skip backup files
+		if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+			continue
+		fi
+
+		# process module
+		. $m
+	done
+fi
+
 if test -z "$XDG_RUNTIME_DIR"; then
     export XDG_RUNTIME_DIR=/run/user/`id -u`
     mkdir --parents $XDG_RUNTIME_DIR

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list