]> code.ossystems Code Review - openembedded-core.git/commitdiff
psplash (sysvinit): add textual updates
authorTrevor Woerner <twoerner@gmail.com>
Thu, 24 Dec 2020 15:31:05 +0000 (10:31 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2021 13:48:07 +0000 (13:48 +0000)
The psplash program contains a hidden text box immediately above the
progress bar. Any text sent via a "MSG" command through psplash's fifo will
be displayed, centred, above the progress bar. Add the ability to show
which startup script is currently running, in sync with updates to the
progress bar. If a startup script takes a bit longer than others and the
progress bar stops momentarily, this allows the user to know which script
is responsible.

This feature is added with a knob, default off, for enabling or disabling
this feature. The knob is in the form of a PACKAGECONFIG against the
sysvinit recipe: psplash-text-updates

NOTE: this knob can be changed in the filesystem at runtime by editing
/etc/default/rcS regardless of how it is set in the build.

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

index 8e76f987c1512df42dbefff487a0e35fa5de4a33..41196ec90bca4e70e6b1fbd1618bfd2264b95242 100755 (executable)
@@ -160,6 +160,9 @@ startup() {
                        #
                        [ -f $previous_start ] && [ ! -f $stop ] && continue
                fi
+               if [ x"${PSPLASH_TEXT_UPDATES}" = x"yes" ]; then
+                       psplash-write "MSG $(basename $i .sh | cut -c 4-)" || true
+               fi
                case "$runlevel" in
                        0|6)
                                startup $i stop
index 76af22b35979cac8371ef1c9dd823eaa00848a58..f7c4a2f841e5eaf15d461a1beb35f8d3f483e9be 100644 (file)
@@ -32,3 +32,5 @@ ROOTFS_READ_ONLY=no
 INIT_SYSTEM=sysvinit
 # set the psplash fifo directory
 PSPLASH_FIFO_DIR=/mnt
+# psplash textual updates knob
+PSPLASH_TEXT_UPDATES=#PSPLASH_TEXT#
index fd39c61fb5d947d8bbf19db35a756a840dba85b5..41009bc1805e0ce306b8cfd662b64e0d1fdf27ad 100644 (file)
@@ -29,6 +29,8 @@ inherit update-alternatives features_check
 DEPENDS_append = " update-rc.d-native base-passwd virtual/crypt"
 do_package_setscene[depends] = "${MLPREFIX}base-passwd:do_populate_sysroot"
 
+PACKAGECONFIG[psplash-text-updates] = ",,"
+
 REQUIRED_DISTRO_FEATURES = "sysvinit"
 
 ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last lastb mesg utmpdump wall"
@@ -91,7 +93,10 @@ do_install () {
                install -d ${D}${sysconfdir}/rc$level.d
        done
 
-       install -m 0644    ${WORKDIR}/rcS-default       ${D}${sysconfdir}/default/rcS
+       sed -e \
+               's:#PSPLASH_TEXT#:${@bb.utils.contains("PACKAGECONFIG","psplash-text-updates","yes","no", d)}:g' \
+               ${WORKDIR}/rcS-default > ${D}${sysconfdir}/default/rcS
+       chmod 0644 ${D}${sysconfdir}/default/rcS
        install -m 0755    ${WORKDIR}/rc                ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/rcS               ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/bootlogd.init     ${D}${sysconfdir}/init.d/bootlogd