Add systemd configuration to launch weston automatically 79/4079/1
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Fri, 25 Sep 2015 11:16:38 +0000 (20:16 +0900)
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Fri, 25 Sep 2015 11:16:38 +0000 (20:16 +0900)
Add systemd configuration to launch weston automatically
while system booting.

Also pam is needed to be added DISTRO_FEATURES to launch
weston-terminal when weston is running by weston-launch
which is used by weston.service.

Change-Id: Id467c3fb19856299ccf80de21a16ae51fe433cc1
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
meta-agl/conf/distro/poky-agl.conf
meta-agl/recipes-core/packagegroups/packagegroup-agl-core-graphics.bb
meta-agl/recipes-graphics/wayland/weston/weston.ini [new file with mode: 0644]
meta-agl/recipes-graphics/wayland/weston/weston.service [new file with mode: 0644]
meta-agl/recipes-graphics/wayland/weston_1.5.0.bbappend [new file with mode: 0644]

index 3ed5a48..8500784 100644 (file)
@@ -19,7 +19,7 @@ VIRTUAL-RUNTIME_init_manager = "systemd"
 VIRTUAL-RUNTIME_initscripts = ""
 
 # Override these in poky based distros
-AGL_DEFAULT_DISTRO_FEATURES = "systemd opengl wayland"
+AGL_DEFAULT_DISTRO_FEATURES = "systemd opengl wayland pam"
 AGL_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
 AGL_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
 
index ffeccd2..58e4e77 100644 (file)
@@ -10,5 +10,5 @@ PACKAGES = "\
 ALLOW_EMPTY_${PN} = "1"
 
 RDEPENDS_${PN} += "\
-    weston-init \
+    ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "weston-init", "", d)} \
     "
diff --git a/meta-agl/recipes-graphics/wayland/weston/weston.ini b/meta-agl/recipes-graphics/wayland/weston/weston.ini
new file mode 100644 (file)
index 0000000..3241204
--- /dev/null
@@ -0,0 +1,2 @@
+[core]
+shell=desktop-shell.so
diff --git a/meta-agl/recipes-graphics/wayland/weston/weston.service b/meta-agl/recipes-graphics/wayland/weston/weston.service
new file mode 100644 (file)
index 0000000..3d25c37
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Weston reference Wayland compositor
+After=dbus.service rc.pvr.service
+
+[Service]
+ExecStart=/usr/bin/weston-launch -u root -- --idle-time=4294967
+ExecStop=/usr/bin/killall -s KILL weston
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl/recipes-graphics/wayland/weston_1.5.0.bbappend b/meta-agl/recipes-graphics/wayland/weston_1.5.0.bbappend
new file mode 100644 (file)
index 0000000..fd195e9
--- /dev/null
@@ -0,0 +1,25 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+
+SRC_URI_append = "\
+    file://weston.service \
+    file://weston.ini \
+    "
+
+inherit systemd
+DEPENDS_append = " systemd"
+
+do_install_append() {
+    mkdir -p ${D}${systemd_unitdir}/system/
+    cp ${WORKDIR}/weston.service ${D}${systemd_unitdir}/system/
+    mkdir -p ${D}${systemd_unitdir}/system/multi-user.target.wants/
+    ln -sf /lib/systemd/system/weston.service ${D}/${systemd_unitdir}/system/multi-user.target.wants/weston.service
+
+    WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
+    install -d ${D}${WESTON_INI_CONFIG}
+    install -m 0644 ${WORKDIR}/weston.ini ${D}${WESTON_INI_CONFIG}/weston.ini
+}
+
+FILES_${PN} += " \
+    ${systemd_unitdir}/system/* \
+    ${sysconfdir}/xdg/weston/weston.ini \
+    "