Use weston-init to startup weston
[AGL/meta-agl.git] / meta-agl / recipes-graphics / wayland / weston-init.bbappend
diff --git a/meta-agl/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644 (file)
index 0000000..9b0f434
--- /dev/null
@@ -0,0 +1,20 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+WESTONTTY ??= "1"
+WESTONUSER ??= "root"
+WESTONARGS ?= "--idle-time=4294967"
+WESTONLAUNCHARGS ??= "--tty /dev/tty${WESTONTTY} --user ${WESTONUSER}"
+
+do_install_append() {
+    sed -e 's,launcher="weston-launch.*--",launcher="weston-launch ${WESTONLAUNCHARGS} --",g' \
+        -e 's,exec openvt $openvt_args --,exec ,g' \
+        -i ${D}${bindir}/weston-start
+
+    sed -e 's,User=root,User=${WESTONUSER},g' \
+        -e 's,$OPTARGS,${WESTONARGS} $OPTARGS,g' \
+        -i ${D}${systemd_system_unitdir}/weston.service
+
+    sed -i "/\[Unit\]/aConflicts=getty@tty${WESTONTTY}.service" \
+           ${D}${systemd_system_unitdir}/weston.service
+}
+