* [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor
@ 2020-12-23 17:06 Trevor Woerner
2020-12-23 17:06 ` [master-next][PATCH 2/3] psplash: work on first boot (sysvinit) Trevor Woerner
2020-12-23 17:06 ` [master-next][PATCH 3/3] sysvinit/rc: improved progress messages Trevor Woerner
0 siblings, 2 replies; 11+ 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] 11+ messages in thread
* [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 17:06 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
@ 2020-12-23 17:06 ` Trevor Woerner
2020-12-23 18:00 ` [OE-core] " Richard Purdie
2020-12-23 17:06 ` [master-next][PATCH 3/3] sysvinit/rc: improved progress messages Trevor Woerner
1 sibling, 1 reply; 11+ messages in thread
From: Trevor Woerner @ 2020-12-23 17:06 UTC (permalink / raw)
To: openembedded-core
The psplash program has a mechanism for showing progress/updates. This
is done via a pipe. On images that are R/O or images that are assembled
via wic, the pipe is being setup in a location that is R/O on first boot,
therefore the pipe can not be created. If the psplash program is not able
to create the pipe, the app will not run. This situation is "fixed" on
non-R/O images when the first bootup is complete. Therefore the psplash
program is able to run for the first shutdown, and all subsequent bootups
and shutdowns as well, but not on the very first boot.
If the directory in which the psplash pipe is to be created already exists in
the filesystem and that location is not R/O on first boot, then the psplash
program can run on first boot (and subsequent boots and shutdowns).
NOTE: this is only an issue with sysvinit and most non-qemu machines. A
systemd image, and images run on qemu machines, are able to run psplash on
the first and subsequent boots.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
meta/recipes-core/psplash/psplash_git.bb | 3 +++
meta/recipes-core/sysvinit/sysvinit/rc | 1 +
meta/recipes-core/sysvinit/sysvinit/rcS-default | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
index 44f0007daf..d70a8aa34e 100644
--- a/meta/recipes-core/psplash/psplash_git.bb
+++ b/meta/recipes-core/psplash/psplash_git.bb
@@ -102,6 +102,7 @@ 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
+ install -d ${D}/.psplash
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
@@ -122,3 +123,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} += "/.psplash"
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 1c956a3a56..61946e56eb 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -177,5 +177,6 @@ if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; th
if type psplash-write >/dev/null 2>&1; then
psplash-write "QUIT" || true
umount -l $PSPLASH_FIFO_DIR
+ rmdir $PSPLASH_FIFO_DIR
fi
fi
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
index 70ab25710e..4330cb853e 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 psplash fifo directory
-PSPLASH_FIFO_DIR=/mnt/.psplash
+PSPLASH_FIFO_DIR=/.psplash
--
2.30.0.rc0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [master-next][PATCH 3/3] sysvinit/rc: improved progress messages
2020-12-23 17:06 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
2020-12-23 17:06 ` [master-next][PATCH 2/3] psplash: work on first boot (sysvinit) Trevor Woerner
@ 2020-12-23 17:06 ` Trevor Woerner
1 sibling, 0 replies; 11+ messages in thread
From: Trevor Woerner @ 2020-12-23 17:06 UTC (permalink / raw)
To: openembedded-core
I noticed that the progress text messages were always a system behind; i.e. if
the current boot script was "networking" the message would indicate the
previous script and would say "networking" next.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
meta/recipes-core/sysvinit/sysvinit/rc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 61946e56eb..15ff660965 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -28,7 +28,6 @@ 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-write "MSG $(basename $1 .sh | cut -c 4-)" || true
psplash-write "PROGRESS $progress" || true
fi
}
@@ -55,7 +54,7 @@ startup() {
"$@"
;;
esac
- startup_progress "$1"
+ startup_progress
}
# Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
@@ -161,6 +160,7 @@ startup() {
#
[ -f $previous_start ] && [ ! -f $stop ] && continue
fi
+ psplash-write "MSG $(basename $i .sh | cut -c 4-)"
case "$runlevel" in
0|6)
startup $i stop
--
2.30.0.rc0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 17:06 ` [master-next][PATCH 2/3] psplash: work on first boot (sysvinit) Trevor Woerner
@ 2020-12-23 18:00 ` Richard Purdie
2020-12-23 21:50 ` Trevor Woerner
0 siblings, 1 reply; 11+ messages in thread
From: Richard Purdie @ 2020-12-23 18:00 UTC (permalink / raw)
To: Trevor Woerner, openembedded-core
On Wed, 2020-12-23 at 12:06 -0500, Trevor Woerner wrote:
The psplash program has a mechanism for showing progress/updates. This
is done via a pipe. On images that are R/O or images that are assembled
via wic, the pipe is being setup in a location that is R/O on first
boot,
therefore the pipe can not be created. If the psplash program is not
able
to create the pipe, the app will not run. This situation is "fixed" on
non-R/O images when the first bootup is complete. Therefore the psplash
program is able to run for the first shutdown, and all subsequent
bootups
and shutdowns as well, but not on the very first boot.
If the directory in which the psplash pipe is to be created already
exists in
the filesystem and that location is not R/O on first boot, then the
psplash
program can run on first boot (and subsequent boots and shutdowns).
NOTE: this is only an issue with sysvinit and most non-qemu machines. A
systemd image, and images run on qemu machines, are able to run psplash
on
the first and subsequent boots.
Personally, I don't really like the idea of having a top level
directory called .psplash, is there a reason it doesn't work in /mnt?
Cheers,
Richard
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 18:00 ` [OE-core] " Richard Purdie
@ 2020-12-23 21:50 ` Trevor Woerner
2020-12-23 22:06 ` Richard Purdie
2020-12-23 22:41 ` Trevor Woerner
0 siblings, 2 replies; 11+ messages in thread
From: Trevor Woerner @ 2020-12-23 21:50 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Wed 2020-12-23 @ 06:00:21 PM, Richard Purdie wrote:
> Personally, I don't really like the idea of having a top level
> directory called .psplash,
Neither do I, which is why I also added the code to remove the directory once
the psplash program is done running. Whenever psplash is run the directory is
created just before it starts and removed when psplash is done.
> is there a reason it doesn't work in /mnt?
This all works fine (without any changes) on the qemuX machines, but on a real
device (e.g. rpi) when the image is booted for the first time everything is
mounted, initially, RO, when using sysvinit. At the end of the first boot, and
for every subsequent boot, the filesystem is R/W, so everything works on
subsequent boots.
On first boot, the error message I get is:
mkfifo: read-only filesystem
When the first boot is done, the last message is something along the lines of
not being able to umount.
If the directory exists in the filesystem already (as part of the image) then
psplash can create the fifo in it.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 21:50 ` Trevor Woerner
@ 2020-12-23 22:06 ` Richard Purdie
2020-12-23 22:35 ` Trevor Woerner
2020-12-23 22:41 ` Trevor Woerner
1 sibling, 1 reply; 11+ messages in thread
From: Richard Purdie @ 2020-12-23 22:06 UTC (permalink / raw)
To: Trevor Woerner; +Cc: openembedded-core
On Wed, 2020-12-23 at 16:50 -0500, Trevor Woerner wrote:
> On Wed 2020-12-23 @ 06:00:21 PM, Richard Purdie wrote:
> > Personally, I don't really like the idea of having a top level
> > directory called .psplash,
>
> Neither do I, which is why I also added the code to remove the
> directory once
> the psplash program is done running. Whenever psplash is run the
> directory is
> created just before it starts and removed when psplash is done.
>
> > is there a reason it doesn't work in /mnt?
>
> This all works fine (without any changes) on the qemuX machines, but
> on a real device (e.g. rpi) when the image is booted for the first
> time everything is mounted, initially, RO, when using sysvinit. At
> the end of the first boot, and for every subsequent boot, the
> filesystem is R/W, so everything works on
> subsequent boots.
Right, but why can't psplash create /mnt/.psplash? Why do we need / and
not /mnt ?
Cheers,
Richard
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 22:06 ` Richard Purdie
@ 2020-12-23 22:35 ` Trevor Woerner
2020-12-23 22:39 ` Richard Purdie
0 siblings, 1 reply; 11+ messages in thread
From: Trevor Woerner @ 2020-12-23 22:35 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Wed 2020-12-23 @ 10:06:05 PM, Richard Purdie wrote:
> On Wed, 2020-12-23 at 16:50 -0500, Trevor Woerner wrote:
> > On Wed 2020-12-23 @ 06:00:21 PM, Richard Purdie wrote:
> > > Personally, I don't really like the idea of having a top level
> > > directory called .psplash,
> >
> > Neither do I, which is why I also added the code to remove the
> > directory once
> > the psplash program is done running. Whenever psplash is run the
> > directory is
> > created just before it starts and removed when psplash is done.
> >
> > > is there a reason it doesn't work in /mnt?
> >
> > This all works fine (without any changes) on the qemuX machines, but
> > on a real device (e.g. rpi) when the image is booted for the first
> > time everything is mounted, initially, RO, when using sysvinit. At
> > the end of the first boot, and for every subsequent boot, the
> > filesystem is R/W, so everything works on
> > subsequent boots.
>
> Right, but why can't psplash create /mnt/.psplash? Why do we need / and
> not /mnt ?
Ah okay.
Let me play with it some more. The only point of /mnt/.psplash (or /.psplash)
is to have a directory in which a tmpfs can be mounted in which the fifo is
created. [this is the current behaviour]
It all sounds rather convoluted. I'll look for something better.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 22:35 ` Trevor Woerner
@ 2020-12-23 22:39 ` Richard Purdie
0 siblings, 0 replies; 11+ messages in thread
From: Richard Purdie @ 2020-12-23 22:39 UTC (permalink / raw)
To: Trevor Woerner; +Cc: openembedded-core
On Wed, 2020-12-23 at 17:35 -0500, Trevor Woerner wrote:
> On Wed 2020-12-23 @ 10:06:05 PM, Richard Purdie wrote:
> > On Wed, 2020-12-23 at 16:50 -0500, Trevor Woerner wrote:
> > > On Wed 2020-12-23 @ 06:00:21 PM, Richard Purdie wrote:
> > > > Personally, I don't really like the idea of having a top level
> > > > directory called .psplash,
> > >
> > > Neither do I, which is why I also added the code to remove the
> > > directory once
> > > the psplash program is done running. Whenever psplash is run the
> > > directory is
> > > created just before it starts and removed when psplash is done.
> > >
> > > > is there a reason it doesn't work in /mnt?
> > >
> > > This all works fine (without any changes) on the qemuX machines,
> > > but
> > > on a real device (e.g. rpi) when the image is booted for the
> > > first
> > > time everything is mounted, initially, RO, when using sysvinit.
> > > At
> > > the end of the first boot, and for every subsequent boot, the
> > > filesystem is R/W, so everything works on
> > > subsequent boots.
> >
> > Right, but why can't psplash create /mnt/.psplash? Why do we need /
> > and
> > not /mnt ?
>
> Ah okay.
>
> Let me play with it some more. The only point of /mnt/.psplash (or
> /.psplash)
> is to have a directory in which a tmpfs can be mounted in which the
> fifo is
> created. [this is the current behaviour]
>
> It all sounds rather convoluted. I'll look for something better.
I remember being involved in trying to make this work.
With sysvinit, /tmp and /var aren't available before populate-volatiles
which is at init ordering "23" which was deemed too late for the splash
screen. The only other option for a rw directory was either to mount
one ourselves (the solution implemented) or maybe use something in
devtmpfs but devtmpfs wasn't really the way people did things back then
and wouldn't work universally.
The world has moved on, could we assume devtmpfs now?
Cheers,
Richard
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 21:50 ` Trevor Woerner
2020-12-23 22:06 ` Richard Purdie
@ 2020-12-23 22:41 ` Trevor Woerner
2020-12-23 22:43 ` Richard Purdie
1 sibling, 1 reply; 11+ messages in thread
From: Trevor Woerner @ 2020-12-23 22:41 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Wed 2020-12-23 @ 04:50:05 PM, Trevor Woerner wrote:
> On Wed 2020-12-23 @ 06:00:21 PM, Richard Purdie wrote:
> > Personally, I don't really like the idea of having a top level
> > directory called .psplash,
>
> Neither do I, which is why I also added the code to remove the directory once
> the psplash program is done running. Whenever psplash is run the directory is
> created just before it starts and removed when psplash is done.
>
> > is there a reason it doesn't work in /mnt?
specifically…
mkdir: can't create directory '/mnt/.psplash': Read-only file system
mount: mounting tmpfs on /mnt/.psplash failed: No such file or directory
mkfifo: Read-only file system
then
umount: can't unmount /mnt/.psplash: No such file or directory
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 22:41 ` Trevor Woerner
@ 2020-12-23 22:43 ` Richard Purdie
2020-12-23 22:55 ` Trevor Woerner
0 siblings, 1 reply; 11+ messages in thread
From: Richard Purdie @ 2020-12-23 22:43 UTC (permalink / raw)
To: Trevor Woerner; +Cc: openembedded-core
On Wed, 2020-12-23 at 17:41 -0500, Trevor Woerner wrote:
> On Wed 2020-12-23 @ 04:50:05 PM, Trevor Woerner wrote:
> > On Wed 2020-12-23 @ 06:00:21 PM, Richard Purdie wrote:
> > > Personally, I don't really like the idea of having a top level
> > > directory called .psplash,
> >
> > Neither do I, which is why I also added the code to remove the
> > directory once
> > the psplash program is done running. Whenever psplash is run the
> > directory is
> > created just before it starts and removed when psplash is done.
> >
> > > is there a reason it doesn't work in /mnt?
>
> specifically…
>
> mkdir: can't create directory '/mnt/.psplash': Read-only file
> system
> mount: mounting tmpfs on /mnt/.psplash failed: No such file
> or directory
> mkfifo: Read-only file system
>
> then
> umount: can't unmount /mnt/.psplash: No such file or
> directory
You're misunderstanding my question. In your patch you create
"/.psplash" in the splash recipe.
Is there a reason the psplash recipe can't create "/mnt/.psplash", i.e.
match the original path ?
Cheers,
Richard
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [master-next][PATCH 2/3] psplash: work on first boot (sysvinit)
2020-12-23 22:43 ` Richard Purdie
@ 2020-12-23 22:55 ` Trevor Woerner
0 siblings, 0 replies; 11+ messages in thread
From: Trevor Woerner @ 2020-12-23 22:55 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Wed 2020-12-23 @ 10:43:03 PM, Richard Purdie wrote:
> You're misunderstanding my question. In your patch you create
> "/.psplash" in the splash recipe.
>
> Is there a reason the psplash recipe can't create "/mnt/.psplash", i.e.
> match the original path ?
Understood. I just wanted to update the email thread with the actual error
messages (instead of going from memory) for posterity.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-12-23 22:55 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 17:06 [master-next][PATCH 1/3] PSPLASH_FIFO_DIR: refactor Trevor Woerner
2020-12-23 17:06 ` [master-next][PATCH 2/3] psplash: work on first boot (sysvinit) Trevor Woerner
2020-12-23 18:00 ` [OE-core] " Richard Purdie
2020-12-23 21:50 ` Trevor Woerner
2020-12-23 22:06 ` Richard Purdie
2020-12-23 22:35 ` Trevor Woerner
2020-12-23 22:39 ` Richard Purdie
2020-12-23 22:41 ` Trevor Woerner
2020-12-23 22:43 ` Richard Purdie
2020-12-23 22:55 ` Trevor Woerner
2020-12-23 17:06 ` [master-next][PATCH 3/3] sysvinit/rc: improved progress messages 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.