summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2016-05-18 13:40:45 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-21 22:21:30 +0100
commit3e7c4d06aaa1fccc1a18f4431122603cc4a9bbe9 (patch)
tree41b1fbb24d9b63c1947b1a6a6789b17bc8cf612d
parent2332f93ae88ca4e4a5aac1806f21104b6489b3bb (diff)
downloadopenembedded-core-3e7c4d06aaa1fccc1a18f4431122603cc4a9bbe9.tar.gz
openembedded-core-3e7c4d06aaa1fccc1a18f4431122603cc4a9bbe9.tar.bz2
openembedded-core-3e7c4d06aaa1fccc1a18f4431122603cc4a9bbe9.zip
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@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/recipes-graphics/wayland/weston-init.bb3
-rwxr-xr-xmeta/recipes-graphics/wayland/weston-init/weston-start26
2 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 3a2251e69a..e4e2701af7 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,@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 dc2b1efc78..4aa7c66d3b 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