All of lore.kernel.org
 help / color / mirror / Atom feed
* [master-next][PATCH 1/3] insane.bbclass: allow fifos
@ 2020-12-24  7:43 Trevor Woerner
  2020-12-24  7:43 ` [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit) Trevor Woerner
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Trevor Woerner @ 2020-12-24  7:43 UTC (permalink / raw)
  To: openembedded-core

Allow recipes to create fifos. If insane.bbclass tries to read() a fifo,
the process will hang waiting for something to read(). Therefore, skip any
check that would try to read() the object, if the object is a fifo.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta/classes/insane.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index cf2165c517..105d2a5ce8 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -87,7 +87,8 @@ def package_qa_add_message(messages, section, new_msg):
 
 QAPATHTEST[shebang-size] = "package_qa_check_shebang_size"
 def package_qa_check_shebang_size(path, name, d, elf, messages):
-    if os.path.islink(path) or elf:
+    import stat
+    if os.path.islink(path) or stat.S_ISFIFO(os.stat(path).st_mode) or elf:
         return
 
     try:
-- 
2.30.0.rc0


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

* [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit)
  2020-12-24  7:43 [master-next][PATCH 1/3] insane.bbclass: allow fifos Trevor Woerner
@ 2020-12-24  7:43 ` Trevor Woerner
  2021-01-04 14:38   ` [OE-core] " Ross Burton
  2020-12-24  7:43 ` [master-next][PATCH 3/3] psplash sysvinit: add knob for verbose progress Trevor Woerner
  2020-12-24  8:34 ` [OE-core] [master-next][PATCH 1/3] insane.bbclass: allow fifos Richard Purdie
  2 siblings, 1 reply; 5+ messages in thread
From: Trevor Woerner @ 2020-12-24  7:43 UTC (permalink / raw)
  To: openembedded-core

Have the fifo used by psplash available in the image on first boot. This
avoids the issue in some scenarios where the fifo can't be created until very
late in the bootup.

The fifo is removed when psplash is done, and created again every time it
runs.

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

diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init
index 68dd708123..31142dfe04 100755
--- a/meta/recipes-core/psplash/files/psplash-init
+++ b/meta/recipes-core/psplash/files/psplash-init
@@ -8,6 +8,7 @@
 ### END INIT INFO
 
 . /etc/default/rcS
+export PSPLASH_FIFO_DIR
 
 if [ ! -e /dev/fb0 ]; then
     echo "Framebuffer /dev/fb0 not detected"
@@ -25,12 +26,6 @@ for x in $CMDLINE; do
         esac
 done
 
-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
-fi
-
 rotation=0
 if [ -e /etc/rotation ]; then
 	read rotation < /etc/rotation
diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
index bb57d25c76..6a9cb9e64d 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,7 +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
-		install -d ${D}/mnt/.psplash
+
+		# make the psplash fifo
+		install -d ${D}/mnt
+		mkfifo ${D}/mnt/psplash_fifo
 	fi
 
 	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
@@ -124,4 +127,4 @@ 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/.psplash"
+FILES_${PN} += "/mnt"
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 15ff660965..c4a2f50f88 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -160,7 +160,7 @@ startup() {
 			#
 			[ -f $previous_start ] && [ ! -f $stop ] && continue
 		fi
-		psplash-write "MSG $(basename $i .sh | cut -c 4-)"
+		psplash-write "MSG $(basename $i .sh | cut -c 4-)" || true
 		case "$runlevel" in
 			0|6)
 				startup $i stop
@@ -176,7 +176,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 $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..e4e5782de5 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=/mnt
-- 
2.30.0.rc0


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

* [master-next][PATCH 3/3] psplash sysvinit: add knob for verbose progress
  2020-12-24  7:43 [master-next][PATCH 1/3] insane.bbclass: allow fifos Trevor Woerner
  2020-12-24  7:43 ` [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit) Trevor Woerner
@ 2020-12-24  7:43 ` Trevor Woerner
  2020-12-24  8:34 ` [OE-core] [master-next][PATCH 1/3] insane.bbclass: allow fifos Richard Purdie
  2 siblings, 0 replies; 5+ messages in thread
From: Trevor Woerner @ 2020-12-24  7:43 UTC (permalink / raw)
  To: openembedded-core

Currently, under sysvinit, the psplash screen shows a graphic, a progress
bar, and a textual message just above the progress bar showing the user which
module is currently running during both bootup and shutdown. This way they can
see, roughly, how much time each module takes to run.

Add a knob, default off, so the user can choose whether or not to display the
textual message indicating the currently-running module.

This knob is added as a PACKAGECONFIG to sysvinit:
	verbose-psplash

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

diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index c4a2f50f88..53a5ce31d2 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -160,7 +160,9 @@ startup() {
 			#
 			[ -f $previous_start ] && [ ! -f $stop ] && continue
 		fi
-		psplash-write "MSG $(basename $i .sh | cut -c 4-)" || true
+		if [ x"${PSPLASH_VERBOSITY}" = 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 e4e5782de5..d3a0f32d2a 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 psplash fifo directory
 PSPLASH_FIFO_DIR=/mnt
+# set the psplash verbosity (sysvinit)
+PSPLASH_VERBOSITY=#PSPLASH_V#
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.97.bb b/meta/recipes-core/sysvinit/sysvinit_2.97.bb
index 98916f7f19..562b20327e 100644
--- a/meta/recipes-core/sysvinit/sysvinit_2.97.bb
+++ b/meta/recipes-core/sysvinit/sysvinit_2.97.bb
@@ -25,6 +25,8 @@ SRC_URI[sha256sum] = "2d5996857519bfd8634d2e1debabb3238fb38440f65fbfdc46420ee8bd
 
 S = "${WORKDIR}/sysvinit-${PV}"
 
+PACKAGECONFIG[verbose-psplash] = ",,"
+
 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"
@@ -91,7 +93,8 @@ do_install () {
 		install -d ${D}${sysconfdir}/rc$level.d
 	done
 
-	install -m 0644    ${WORKDIR}/rcS-default	${D}${sysconfdir}/default/rcS
+	sed -e 's:#PSPLASH_V#:${@bb.utils.contains("PACKAGECONFIG","verbose-psplash","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] 5+ messages in thread

* Re: [OE-core] [master-next][PATCH 1/3] insane.bbclass: allow fifos
  2020-12-24  7:43 [master-next][PATCH 1/3] insane.bbclass: allow fifos Trevor Woerner
  2020-12-24  7:43 ` [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit) Trevor Woerner
  2020-12-24  7:43 ` [master-next][PATCH 3/3] psplash sysvinit: add knob for verbose progress Trevor Woerner
@ 2020-12-24  8:34 ` Richard Purdie
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2020-12-24  8:34 UTC (permalink / raw)
  To: Trevor Woerner, openembedded-core

On Thu, 2020-12-24 at 02:43 -0500, Trevor Woerner wrote:
> Allow recipes to create fifos. If insane.bbclass tries to read() a
> fifo,
> the process will hang waiting for something to read(). Therefore,
> skip any
> check that would try to read() the object, if the object is a fifo.
> 
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
>  meta/classes/insane.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/insane.bbclass
> b/meta/classes/insane.bbclass
> index cf2165c517..105d2a5ce8 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -87,7 +87,8 @@ def package_qa_add_message(messages, section,
> new_msg):
>  
>  QAPATHTEST[shebang-size] = "package_qa_check_shebang_size"
>  def package_qa_check_shebang_size(path, name, d, elf, messages):
> -    if os.path.islink(path) or elf:
> +    import stat
> +    if os.path.islink(path) or stat.S_ISFIFO(os.stat(path).st_mode)
> or elf:
>          return
>  
>      try:

Good catch, I think there has been a bug open for a while to fix this
one!

With the rest of the series, I can't get the patches to apply, I think
there is one that wasn't sent to the list. I've added this fifo fix to
-next since its ready, for the rest could you send a series against
master please? That should allow some cleanup of the patches now we
know where we're going too!

Cheers,

Richard



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

* Re: [OE-core] [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit)
  2020-12-24  7:43 ` [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit) Trevor Woerner
@ 2021-01-04 14:38   ` Ross Burton
  0 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2021-01-04 14:38 UTC (permalink / raw)
  To: Trevor Woerner; +Cc: OE-core

On Thu, 24 Dec 2020 at 07:44, Trevor Woerner <twoerner@gmail.com> wrote:
> -DEPENDS = "gdk-pixbuf-native"
> +DEPENDS = "gdk-pixbuf-native coreutils-native"

For reasons that I'm still digging into, using coreutils-native's cp
causes pseudo to crash.

Can we just add mkfifo to HOSTTOOLS?

Ross

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

end of thread, other threads:[~2021-01-04 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24  7:43 [master-next][PATCH 1/3] insane.bbclass: allow fifos Trevor Woerner
2020-12-24  7:43 ` [master-next][PATCH 2/3] psplash: add fifo to initial image (sysvinit) Trevor Woerner
2021-01-04 14:38   ` [OE-core] " Ross Burton
2020-12-24  7:43 ` [master-next][PATCH 3/3] psplash sysvinit: add knob for verbose progress Trevor Woerner
2020-12-24  8:34 ` [OE-core] [master-next][PATCH 1/3] insane.bbclass: allow fifos Richard Purdie

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.