]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
psplash: start via udev if framebuffer device detected
authorMikko Rapeli <mikko.rapeli@linaro.org>
Thu, 6 Feb 2025 14:44:06 +0000 (16:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 17 Feb 2025 22:06:55 +0000 (22:06 +0000)
psplash-start.service expected to find /dev/fb0 and failed
if device was not found. This failure breaks systemd
oeqa runtime test with "runqemu nographic". Starting
psplash based on detected framebuffer device fixes systemd
boot status and systemd oeqa runtime tests for qemu
boots with and without graphics support.

Note that psplash-systemd.service still depends on /dev/fb0
so startup with multiple framebuffer devices may not work
correctly. I don't have devices with multiple framebuffer
devices to test with.

On qemu machine with graphics, psplash displays yocto
logo correctly and boot progress bar as well. Once boot completes
to systemd "running" state, the logo is replaced by login prompt.
On qemu machine without graphics, boot completes without psplash
or failures and login over serial console works normally.
Tested with genericarm64 machine poky-altcfg distro and core-image-base
image on qemu. AMD kv260 tested as well but graphics stack is not yet
working there so boot is similar to qemu without graphics.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/psplash/files/fb.rules [new file with mode: 0644]
meta/recipes-core/psplash/files/psplash-start@.service [moved from meta/recipes-core/psplash/files/psplash-start.service with 84% similarity]
meta/recipes-core/psplash/files/psplash-systemd.service
meta/recipes-core/psplash/psplash_git.bb

diff --git a/meta/recipes-core/psplash/files/fb.rules b/meta/recipes-core/psplash/files/fb.rules
new file mode 100644 (file)
index 0000000..accdb83
--- /dev/null
@@ -0,0 +1 @@
+SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="psplash-start@%k.service psplash-systemd.service"
similarity index 84%
rename from meta/recipes-core/psplash/files/psplash-start.service
rename to meta/recipes-core/psplash/files/psplash-start@.service
index bec9368427a4a6703962a42513eb5803564bbeaf..1bc3642fc2a09a423ec9fbd3827dfe95dab57a3a 100644 (file)
@@ -3,11 +3,10 @@ Description=Start psplash boot splash screen
 DefaultDependencies=no
 RequiresMountsFor=/run
 ConditionFileIsExecutable=/usr/bin/psplash
+After=dev-%i.device
+Wants=dev-%i.device
 
 [Service]
 Type=notify
 ExecStart=/usr/bin/psplash
 RemainAfterExit=yes
-
-[Install]
-WantedBy=sysinit.target
index e93e3deb35aa386eea6076ff97582871a1a26469..f9aaa2db3dade210de061594b8a3e88056b755ff 100644 (file)
@@ -1,14 +1,12 @@
 [Unit]
 Description=Start psplash-systemd progress communication helper
 DefaultDependencies=no
-After=psplash-start.service
-Requires=psplash-start.service
+After=psplash-start@fb0.service
+Requires=psplash-start@fb0.service
 RequiresMountsFor=/run
 ConditionFileIsExecutable=/usr/bin/psplash
+ConditionFileExists=/run/psplash_fifo
 
 [Service]
 ExecStart=/usr/bin/psplash-systemd
 RemainAfterExit=yes
-
-[Install]
-WantedBy=sysinit.target
index 30cf61a2cb5b80849dc04fc083cf7b5b55c58e83..fce5995efedde4d77fc5143dc3232c6208962e42 100644 (file)
@@ -11,8 +11,9 @@ PV = "0.1+git"
 
 SRC_URI = "git://git.yoctoproject.org/${BPN};branch=master;protocol=https \
            file://psplash-init \
-           file://psplash-start.service \
+           file://psplash-start@.service \
            file://psplash-systemd.service \
+           file://fb.rules \
            ${SPLASH_IMAGES}"
 UPSTREAM_CHECK_COMMITS = "1"
 
@@ -112,8 +113,10 @@ do_install:append() {
 
        if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
                install -d ${D}${systemd_system_unitdir}
-               install -m 644 ${UNPACKDIR}/psplash-start.service ${D}/${systemd_system_unitdir}
+               install -m 644 ${UNPACKDIR}/psplash-start@.service ${D}/${systemd_system_unitdir}
                install -m 644 ${UNPACKDIR}/psplash-systemd.service ${D}/${systemd_system_unitdir}
+               install -d ${D}${sysconfdir}/udev/rules.d
+               install -m 0644 ${UNPACKDIR}/fb.rules ${D}${sysconfdir}/udev/rules.d/
        fi
 
        install -d ${D}${bindir}
@@ -124,7 +127,7 @@ do_install:append() {
 }
 
 SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
-SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'psplash-start.service psplash-systemd.service', '', d)}"
+SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'psplash-start@.service psplash-systemd.service', '', d)}"
 
 INITSCRIPT_NAME = "psplash.sh"
 INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."