All of lore.kernel.org
 help / color / mirror / Atom feed
* [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor
@ 2020-12-24 15:31 Trevor Woerner
  2020-12-24 15:31 ` [master-next][PATCH 2/3] psplash: fix working on first boot (sysvinit) Trevor Woerner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Trevor Woerner @ 2020-12-24 15:31 UTC (permalink / raw)
  To: openembedded-core

Add an entry for the psplash fifo directory to /etc/default/rcS and have the
pieces of code that need it source it from there rather than duplicating the
definition in multiple places throughout the code.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/recipes-core/psplash/files/psplash-init    | 4 +++-
 meta/recipes-core/sysvinit/sysvinit/rc          | 5 +++--
 meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init
index f58e043733..e0f80bcdc0 100755
--- a/meta/recipes-core/psplash/files/psplash-init
+++ b/meta/recipes-core/psplash/files/psplash-init
@@ -7,6 +7,9 @@
 # Default-Stop:
 ### END INIT INFO
 
+. /etc/default/rcS
+export PSPLASH_FIFO_DIR
+
 if [ ! -e /dev/fb0 ]; then
     echo "Framebuffer /dev/fb0 not detected"
     echo "Boot splashscreen disabled"
@@ -23,7 +26,6 @@ for x in $CMDLINE; do
         esac
 done
 
-export PSPLASH_FIFO_DIR=/mnt/.psplash
 [ -d $PSPLASH_FIFO_DIR ] || mkdir -p $PSPLASH_FIFO_DIR
 if ! mountpoint -q $PSPLASH_FIFO_DIR; then
 	mount tmpfs -t tmpfs $PSPLASH_FIFO_DIR -o,size=40k
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index d0d3149821..c9f6558115 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -17,6 +17,7 @@
 
 . /etc/default/rcS
 export VERBOSE
+export PSPLASH_FIFO_DIR
 
 startup_progress() {
     step=$(($step + $step_change))
@@ -27,7 +28,7 @@ startup_progress() {
     fi
     #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
     if type psplash-write >/dev/null 2>&1; then
-        PSPLASH_FIFO_DIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
+        psplash-write "PROGRESS $progress" || true
     fi
 }
 
@@ -173,7 +174,7 @@ startup() {
 #Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
 if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
     if type psplash-write >/dev/null 2>&1; then
-        PSPLASH_FIFO_DIR=/mnt/.psplash psplash-write "QUIT" || true
+        psplash-write "QUIT" || true
     	umount -l /mnt/.psplash
     fi
 fi
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
index e608a77c75..c576ff0678 100644
--- a/meta/recipes-core/sysvinit/sysvinit/rcS-default
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -30,3 +30,5 @@ ROOTFS_READ_ONLY=no
 # rcS is also used when using busybox init and shares initscripts, some initscripts
 # need to have specific behavior depending on init system
 INIT_SYSTEM=sysvinit
+# set the psplash fifo directory
+PSPLASH_FIFO_DIR=/mnt/.psplash
-- 
2.30.0.rc0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [master-next][PATCH 2/3] psplash: fix working on first boot (sysvinit)
  2020-12-24 15:31 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
@ 2020-12-24 15:31 ` Trevor Woerner
  2020-12-24 15:31 ` [master-next][PATCH 3/3] psplash (sysvinit): add textual updates Trevor Woerner
  2020-12-30 14:10 ` [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Richard Purdie
  2 siblings, 0 replies; 6+ messages in thread
From: Trevor Woerner @ 2020-12-24 15:31 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/recipes-core/psplash/psplash_git.bb        | 8 +++++++-
 meta/recipes-core/sysvinit/sysvinit/rc          | 1 -
 meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
index 44f0007daf..0a19a664c0 100644
--- a/meta/recipes-core/psplash/psplash_git.bb
+++ b/meta/recipes-core/psplash/psplash_git.bb
@@ -4,7 +4,7 @@ HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash"
 SECTION = "base"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=8;md5=8f232c1e95929eacab37f00900580224"
-DEPENDS = "gdk-pixbuf-native"
+DEPENDS = "gdk-pixbuf-native coreutils-native"
 
 SRCREV = "0a902f7cd875ccf018456451be369f05fa55f962"
 PV = "0.1+git${SRCPV}"
@@ -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"
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index c9f6558115..8e76f987c1 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -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
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
index c576ff0678..76af22b359 100644
--- a/meta/recipes-core/sysvinit/sysvinit/rcS-default
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -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
-- 
2.30.0.rc0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [master-next][PATCH 3/3] psplash (sysvinit): add textual updates
  2020-12-24 15:31 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
  2020-12-24 15:31 ` [master-next][PATCH 2/3] psplash: fix working on first boot (sysvinit) Trevor Woerner
@ 2020-12-24 15:31 ` Trevor Woerner
  2020-12-30 14:10 ` [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Richard Purdie
  2 siblings, 0 replies; 6+ messages in thread
From: Trevor Woerner @ 2020-12-24 15:31 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/recipes-core/sysvinit/sysvinit/rc          | 3 +++
 meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 ++
 meta/recipes-core/sysvinit/sysvinit_2.97.bb     | 7 ++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 8e76f987c1..41196ec90b 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -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
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
index 76af22b359..f7c4a2f841 100644
--- a/meta/recipes-core/sysvinit/sysvinit/rcS-default
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -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#
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.97.bb b/meta/recipes-core/sysvinit/sysvinit_2.97.bb
index 98916f7f19..03099bf157 100644
--- a/meta/recipes-core/sysvinit/sysvinit_2.97.bb
+++ b/meta/recipes-core/sysvinit/sysvinit_2.97.bb
@@ -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
-- 
2.30.0.rc0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor
  2020-12-24 15:31 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
  2020-12-24 15:31 ` [master-next][PATCH 2/3] psplash: fix working on first boot (sysvinit) Trevor Woerner
  2020-12-24 15:31 ` [master-next][PATCH 3/3] psplash (sysvinit): add textual updates Trevor Woerner
@ 2020-12-30 14:10 ` Richard Purdie
  2020-12-31  7:55   ` Naveen Saini
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2020-12-30 14:10 UTC (permalink / raw)
  To: Trevor Woerner, openembedded-core; +Cc: Ross Burton, Jon Mason, Naveen Saini

On Thu, 2020-12-24 at 10:31 -0500, Trevor Woerner wrote:
> Add an entry for the psplash fifo directory to /etc/default/rcS and
> have the
> pieces of code that need it source it from there rather than
> duplicating the
> definition in multiple places throughout the code.
> 
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
>  meta/recipes-core/psplash/files/psplash-init    | 4 +++-
>  meta/recipes-core/sysvinit/sysvinit/rc          | 5 +++--
>  meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 ++
>  3 files changed, 8 insertions(+), 3 deletions(-)

Unfortunately this doesn't seem to build on arm hosts, something to do
with the fifo I'd guess, e.g.:

https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/2179

I've not looked any further due to holidays but this probably needs a
bugzilla entry and further investigation. Series is on hold until we
get to the bottom of this.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor
  2020-12-30 14:10 ` [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Richard Purdie
@ 2020-12-31  7:55   ` Naveen Saini
  0 siblings, 0 replies; 6+ messages in thread
From: Naveen Saini @ 2020-12-31  7:55 UTC (permalink / raw)
  To: Richard Purdie, Trevor Woerner, openembedded-core; +Cc: Ross Burton, Jon Mason



> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: Wednesday, December 30, 2020 10:10 PM
> To: Trevor Woerner <twoerner@gmail.com>; openembedded-
> core@lists.openembedded.org
> Cc: Ross Burton <ross.burton@arm.com>; Jon Mason
> <Jon.Mason@arm.com>; Saini, Naveen Kumar
> <naveen.kumar.saini@intel.com>
> Subject: Re: [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR:
> refactor
> 
> On Thu, 2020-12-24 at 10:31 -0500, Trevor Woerner wrote:
> > Add an entry for the psplash fifo directory to /etc/default/rcS and
> > have the pieces of code that need it source it from there rather than
> > duplicating the definition in multiple places throughout the code.
> >
> > Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> > ---
> >  meta/recipes-core/psplash/files/psplash-init    | 4 +++-
> >  meta/recipes-core/sysvinit/sysvinit/rc          | 5 +++--
> >  meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 ++
> >  3 files changed, 8 insertions(+), 3 deletions(-)
> 
> Unfortunately this doesn't seem to build on arm hosts, something to do with
> the fifo I'd guess, e.g.:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/2179
> 
> I've not looked any further due to holidays but this probably needs a bugzilla
> entry and further investigation. Series is on hold until we get to the bottom
> of this.
[SWAT] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14173

> 
> Cheers,
> 
> Richard
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor
@ 2020-12-23 17:06 Trevor Woerner
  0 siblings, 0 replies; 6+ messages in thread
From: Trevor Woerner @ 2020-12-23 17:06 UTC (permalink / raw)
  To: openembedded-core

Add an entry for the psplash fifo directory to /etc/default/rcS and have the
pieces that need it, source it from there rather than duplicating the location
in multiple places throughout the code.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/recipes-core/psplash/files/psplash-init    | 4 +++-
 meta/recipes-core/sysvinit/sysvinit/rc          | 9 +++++----
 meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 ++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init
index f58e043733..68dd708123 100755
--- a/meta/recipes-core/psplash/files/psplash-init
+++ b/meta/recipes-core/psplash/files/psplash-init
@@ -7,6 +7,8 @@
 # Default-Stop:
 ### END INIT INFO
 
+. /etc/default/rcS
+
 if [ ! -e /dev/fb0 ]; then
     echo "Framebuffer /dev/fb0 not detected"
     echo "Boot splashscreen disabled"
@@ -23,7 +25,7 @@ for x in $CMDLINE; do
         esac
 done
 
-export PSPLASH_FIFO_DIR=/mnt/.psplash
+export PSPLASH_FIFO_DIR
 [ -d $PSPLASH_FIFO_DIR ] || mkdir -p $PSPLASH_FIFO_DIR
 if ! mountpoint -q $PSPLASH_FIFO_DIR; then
 	mount tmpfs -t tmpfs $PSPLASH_FIFO_DIR -o,size=40k
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 6995930ee9..1c956a3a56 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -17,6 +17,7 @@
 
 . /etc/default/rcS
 export VERBOSE
+export PSPLASH_FIFO_DIR
 
 startup_progress() {
     step=$(($step + $step_change))
@@ -27,8 +28,8 @@ startup_progress() {
     fi
     #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
     if type psplash-write >/dev/null 2>&1; then
-        PSPLASH_FIFO_DIR=/mnt/.psplash psplash-write "MSG $(basename $1 .sh | cut -c 4-)" || true
-        PSPLASH_FIFO_DIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
+        psplash-write "MSG $(basename $1 .sh | cut -c 4-)" || true
+        psplash-write "PROGRESS $progress" || true
     fi
 }
 
@@ -174,7 +175,7 @@ startup() {
 #Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
 if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
     if type psplash-write >/dev/null 2>&1; then
-        PSPLASH_FIFO_DIR=/mnt/.psplash psplash-write "QUIT" || true
-    	umount -l /mnt/.psplash
+        psplash-write "QUIT" || true
+        umount -l $PSPLASH_FIFO_DIR
     fi
 fi
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
index e608a77c75..70ab25710e 100644
--- a/meta/recipes-core/sysvinit/sysvinit/rcS-default
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -30,3 +30,5 @@ ROOTFS_READ_ONLY=no
 # rcS is also used when using busybox init and shares initscripts, some initscripts
 # need to have specific behavior depending on init system
 INIT_SYSTEM=sysvinit
+# set psplash fifo directory
+PSPLASH_FIFO_DIR=/mnt/.psplash
-- 
2.30.0.rc0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-31  7:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 15:31 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
2020-12-24 15:31 ` [master-next][PATCH 2/3] psplash: fix working on first boot (sysvinit) Trevor Woerner
2020-12-24 15:31 ` [master-next][PATCH 3/3] psplash (sysvinit): add textual updates Trevor Woerner
2020-12-30 14:10 ` [OE-core] [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Richard Purdie
2020-12-31  7:55   ` Naveen Saini
  -- strict thread matches above, loose matches on Subject: below --
2020-12-23 17:06 Trevor Woerner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.