diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2020-01-22 14:20:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-25 10:41:22 +0000 |
commit | 9ae26cfeea354039c1bdb42fb7289be55115681d (patch) | |
tree | eeddb1f02e41487e4312247e73c6f2216fe8c459 /meta/recipes-core | |
parent | 6c43f76248b5c37ce213667cb794ff81901cc3b1 (diff) | |
download | poky-9ae26cfeea354039c1bdb42fb7289be55115681d.tar.gz |
psplash: add systemd support
Make use of the recently added systemd support in psplash. The utility
psplash-systemd communicates boot progress to the splash screen. The
splash is disabled once systemd consideres the system fully booted
(progress is at 1.0). Note that this can take a while if systemd is
stuck on a failing unit.
This change adds two systemd services. One service starts psplash itself
(psplash-start.service) and the second service starts the helper utility
psplash-systemd (psplash-systemd.service). The units are written such
that psplash-systemd.service can be used indepenendenly. This is useful
when starting psplash in initramfs (not using systemd).
(From OE-Core rev: b4063b16082604554c7c19b369ebddd27061f372)
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rwxr-xr-x | meta/recipes-core/psplash/files/psplash-init | 8 | ||||
-rw-r--r-- | meta/recipes-core/psplash/files/psplash-start.service | 10 | ||||
-rw-r--r-- | meta/recipes-core/psplash/files/psplash-systemd.service | 10 | ||||
-rw-r--r-- | meta/recipes-core/psplash/psplash_git.bb | 38 |
4 files changed, 47 insertions, 19 deletions
diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init index 4bee866b0d..f58e043733 100755 --- a/meta/recipes-core/psplash/files/psplash-init +++ b/meta/recipes-core/psplash/files/psplash-init | |||
@@ -23,10 +23,10 @@ for x in $CMDLINE; do | |||
23 | esac | 23 | esac |
24 | done | 24 | done |
25 | 25 | ||
26 | export TMPDIR=/mnt/.psplash | 26 | export PSPLASH_FIFO_DIR=/mnt/.psplash |
27 | [ -d $TMPDIR ] || mkdir -p $TMPDIR | 27 | [ -d $PSPLASH_FIFO_DIR ] || mkdir -p $PSPLASH_FIFO_DIR |
28 | if ! mountpoint -q $TMPDIR; then | 28 | if ! mountpoint -q $PSPLASH_FIFO_DIR; then |
29 | mount tmpfs -t tmpfs $TMPDIR -o,size=40k | 29 | mount tmpfs -t tmpfs $PSPLASH_FIFO_DIR -o,size=40k |
30 | fi | 30 | fi |
31 | 31 | ||
32 | rotation=0 | 32 | rotation=0 |
diff --git a/meta/recipes-core/psplash/files/psplash-start.service b/meta/recipes-core/psplash/files/psplash-start.service new file mode 100644 index 0000000000..9de8f6321a --- /dev/null +++ b/meta/recipes-core/psplash/files/psplash-start.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Start psplash boot splash screen | ||
3 | DefaultDependencies=no | ||
4 | Requires=psplash-systemd.service | ||
5 | |||
6 | [Service] | ||
7 | ExecStart=/usr/bin/psplash | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=sysinit.target | ||
diff --git a/meta/recipes-core/psplash/files/psplash-systemd.service b/meta/recipes-core/psplash/files/psplash-systemd.service new file mode 100644 index 0000000000..e14f42032d --- /dev/null +++ b/meta/recipes-core/psplash/files/psplash-systemd.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Start psplash-systemd progress communication helper | ||
3 | DefaultDependencies=no | ||
4 | After=systemd-start.service | ||
5 | |||
6 | [Service] | ||
7 | ExecStart=/usr/bin/psplash-systemd | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=sysinit.target | ||
diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb index 56734c1582..6ff0393194 100644 --- a/meta/recipes-core/psplash/psplash_git.bb +++ b/meta/recipes-core/psplash/psplash_git.bb | |||
@@ -3,14 +3,16 @@ DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly em | |||
3 | HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash" | 3 | HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash" |
4 | SECTION = "base" | 4 | SECTION = "base" |
5 | LICENSE = "GPLv2+" | 5 | LICENSE = "GPLv2+" |
6 | LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6" | 6 | LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=8;md5=8f232c1e95929eacab37f00900580224" |
7 | 7 | ||
8 | SRCREV = "2015f7073e98dd9562db0936a254af5ef56356cf" | 8 | SRCREV = "773a3977d255e8f59a741ad6ce37c4d40f1feaa1" |
9 | PV = "0.1+git${SRCPV}" | 9 | PV = "0.1+git${SRCPV}" |
10 | PR = "r15" | 10 | PR = "r15" |
11 | 11 | ||
12 | SRC_URI = "git://git.yoctoproject.org/${BPN} \ | 12 | SRC_URI = "git://git.yoctoproject.org/${BPN} \ |
13 | file://psplash-init \ | 13 | file://psplash-init \ |
14 | file://psplash-start.service \ | ||
15 | file://psplash-systemd.service \ | ||
14 | ${SPLASH_IMAGES}" | 16 | ${SPLASH_IMAGES}" |
15 | UPSTREAM_CHECK_COMMITS = "1" | 17 | UPSTREAM_CHECK_COMMITS = "1" |
16 | 18 | ||
@@ -66,7 +68,11 @@ python __anonymous() { | |||
66 | 68 | ||
67 | S = "${WORKDIR}/git" | 69 | S = "${WORKDIR}/git" |
68 | 70 | ||
69 | inherit autotools pkgconfig update-rc.d update-alternatives | 71 | inherit autotools pkgconfig update-rc.d update-alternatives systemd |
72 | |||
73 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | ||
74 | |||
75 | PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" | ||
70 | 76 | ||
71 | ALTERNATIVE_PRIORITY = "100" | 77 | ALTERNATIVE_PRIORITY = "100" |
72 | ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash" | 78 | ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash" |
@@ -97,8 +103,17 @@ python do_compile () { | |||
97 | } | 103 | } |
98 | 104 | ||
99 | do_install_append() { | 105 | do_install_append() { |
100 | install -d ${D}${sysconfdir}/init.d/ | 106 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
101 | install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh | 107 | install -d ${D}${sysconfdir}/init.d/ |
108 | install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh | ||
109 | fi | ||
110 | |||
111 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
112 | install -d ${D}${systemd_unitdir}/system | ||
113 | install -m 644 ${WORKDIR}/psplash-start.service ${D}/${systemd_unitdir}/system | ||
114 | install -m 644 ${WORKDIR}/psplash-systemd.service ${D}/${systemd_unitdir}/system | ||
115 | fi | ||
116 | |||
102 | install -d ${D}${bindir} | 117 | install -d ${D}${bindir} |
103 | for i in ${SPLASH_INSTALL} ; do | 118 | for i in ${SPLASH_INSTALL} ; do |
104 | install -m 0755 $i ${D}${bindir}/$i | 119 | install -m 0755 $i ${D}${bindir}/$i |
@@ -106,15 +121,8 @@ do_install_append() { | |||
106 | rm -f ${D}${bindir}/psplash | 121 | rm -f ${D}${bindir}/psplash |
107 | } | 122 | } |
108 | 123 | ||
124 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
125 | SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'psplash-start.service psplash-systemd.service', '', d)}" | ||
126 | |||
109 | INITSCRIPT_NAME = "psplash.sh" | 127 | INITSCRIPT_NAME = "psplash.sh" |
110 | INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ." | 128 | INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ." |
111 | |||
112 | PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}" | ||
113 | pkg_postinst_${PN} () { | ||
114 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
115 | if [ -n "$D" ]; then | ||
116 | OPTS="--root=$D" | ||
117 | fi | ||
118 | systemctl $OPTS mask psplash.service | ||
119 | fi | ||
120 | } | ||