]> code.ossystems Code Review - openembedded-core.git/commitdiff
psplash: fix working on first boot (sysvinit)
authorTrevor Woerner <twoerner@gmail.com>
Thu, 24 Dec 2020 15:31:04 +0000 (10:31 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2021 13:48:07 +0000 (13:48 +0000)
The psplash program has a mechanism for showing updates graphically in the
form of a progress bar. The program is told when and how much to fill the
progress bar via text messages sent through a fifo. If the fifo doesn't exist
when the psplash program starts, it tries to create it. If the fifo doesn't
exist or can't be created, the psplash program will refuse to run.

In various circumstances when a system is booted for the very first time,
the filesystem is mounted, initially, read-only. As a result the psplash
program is not able to run. On systems where the root filesystem is not
meant to be read-only, it will eventually be mounted read-write. Therefore the
psplash program can run on shutdown, and all subsequent boots. Only the first
boot is affected.

If a fifo is created and included in the filesystem as part of the recipe,
then filesystems that are meant to be read-only will have psplash work, as
well as the cases where (on first boot) a read-write filesystem is initially
mounted read-only.

NOTE: this is only an issue with sysvinit, and non-qemu machines.
systemd-based systems don't suffer from this first-boot issue, and neither
do the qemu machines.

NOTE 2: when psplash is done, it removes the fifo. Therefore the fifo used
for communicating with psplash doesn't hang around unnecessarily in the
filesystem.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/psplash/psplash_git.bb
meta/recipes-core/sysvinit/sysvinit/rc
meta/recipes-core/sysvinit/sysvinit/rcS-default

index 44f0007daf0ec24cda9f515652b53fb74fee424a..59e1e3f194e90745bfd6463946440e73a1718b9d 100644 (file)
@@ -102,6 +102,10 @@ do_install_append() {
        if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
                install -d ${D}${sysconfdir}/init.d/
                install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh
+
+               # make fifo for psplash
+               install -d ${D}/mnt
+               mkfifo ${D}/mnt/psplash_fifo
        fi
 
        if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
@@ -122,3 +126,5 @@ SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'pspl
 
 INITSCRIPT_NAME = "psplash.sh"
 INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
+
+FILES_${PN} += "/mnt"
index c9f65581156843dd38479a23d144fe528a4d768a..8e76f987c1512df42dbefff487a0e35fa5de4a33 100755 (executable)
@@ -175,6 +175,5 @@ startup() {
 if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
     if type psplash-write >/dev/null 2>&1; then
         psplash-write "QUIT" || true
-       umount -l /mnt/.psplash
     fi
 fi
index c576ff0678a53758c68d2bccf7c85707189aa82b..76af22b35979cac8371ef1c9dd823eaa00848a58 100644 (file)
@@ -31,4 +31,4 @@ ROOTFS_READ_ONLY=no
 # need to have specific behavior depending on init system
 INIT_SYSTEM=sysvinit
 # set the psplash fifo directory
-PSPLASH_FIFO_DIR=/mnt/.psplash
+PSPLASH_FIFO_DIR=/mnt