Add systemd configuration to launch psplash 81/4081/1
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Fri, 25 Sep 2015 11:24:42 +0000 (20:24 +0900)
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Fri, 25 Sep 2015 11:24:42 +0000 (20:24 +0900)
Change-Id: I11c704890440b6412698c5067effcafb8b4849e8
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
meta-agl/recipes-core/psplash/files/psplash-quit.service [new file with mode: 0644]
meta-agl/recipes-core/psplash/files/psplash-start.service [new file with mode: 0644]
meta-agl/recipes-core/psplash/psplash_git.bbappend

diff --git a/meta-agl/recipes-core/psplash/files/psplash-quit.service b/meta-agl/recipes-core/psplash/files/psplash-quit.service
new file mode 100644 (file)
index 0000000..14bd499
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Terminate Psplash Boot Screen
+After=psplash-start.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/psplash-write QUIT
+TimeoutSec=20
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl/recipes-core/psplash/files/psplash-start.service b/meta-agl/recipes-core/psplash/files/psplash-start.service
new file mode 100644 (file)
index 0000000..7881e73
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Start Psplash Boot Screen
+Wants=systemd-vconsole-setup.service
+After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service
+DefaultDependencies=no
+
+[Service]
+ExecStart=/usr/bin/psplash -n
+
+[Install]
+WantedBy=sysinit.target
index 193ecfb..3b4f851 100644 (file)
@@ -1,10 +1,25 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
 
-SRC_URI += "file://psplash-colors.h"
+SRC_URI += "file://psplash-colors.h \
+            file://psplash-start.service \
+            file://psplash-quit.service \
+            "
 
 SPLASH_IMAGES="file://psplash-poky-img.h;outsuffix=default"
 
+inherit systemd
+
+SYSTEMD_PACKAGES = "${@base_contains('DISTRO_FEATURES', 'systemd', '${PN}', '', d)}"
+SYSTEMD_SERVICE_${PN} = "${@base_contains('DISTRO_FEATURES', 'systemd', 'psplash-start.service psplash-quit.service', '', d)}"
+
 do_configure_append () {
        cd ${S}
        cp ../psplash-colors.h ./
 }
+
+do_install_append () {
+    if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 644 ${WORKDIR}/*.service ${D}/${systemd_unitdir}/system
+    fi
+}