All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes two warnings when boot with qemuppc64
@ 2021-04-07 12:18 Kevin Hao
  2021-04-07 12:18 ` [PATCH 1/3] modutils-initscripts: Bail out when no module is installed Kevin Hao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kevin Hao @ 2021-04-07 12:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie

Fixes two following warnings:
  depmod: can't change directory to 'lib/modules/5.10.25-yocto-standard': No such file or directory
  INIT: Id "hvc0" respawning too fast: disabled for 5 minutes

Kevin Hao (3):
  modutils-initscripts: Bail out when no module is installed
  sysvinit-inittab/start_getty: Check /sys for the tty device existence
  Revert "inittab: Add getty launch on hvc0 for qemuppc64"

 .../busybox/busybox-inittab_1.33.0.bb         |  3 --
 .../sysvinit/sysvinit-inittab/start_getty     | 44 ++-----------------
 .../sysvinit/sysvinit-inittab_2.88dsf.bb      |  4 --
 .../modutils-initscripts/files/modutils.sh    |  1 +
 4 files changed, 4 insertions(+), 48 deletions(-)

-- 
2.30.2


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

* [PATCH 1/3] modutils-initscripts: Bail out when no module is installed
  2021-04-07 12:18 [PATCH 0/3] Fixes two warnings when boot with qemuppc64 Kevin Hao
@ 2021-04-07 12:18 ` Kevin Hao
  2021-04-07 12:18 ` [PATCH 2/3] sysvinit-inittab/start_getty: Check /sys for the tty device existence Kevin Hao
  2021-04-07 12:18 ` [PATCH 3/3] Revert "inittab: Add getty launch on hvc0 for qemuppc64" Kevin Hao
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Hao @ 2021-04-07 12:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie

Fix the following warning when boot with a core-image-minimal rootfs:
  depmod: can't change directory to 'lib/modules/5.10.25-yocto-standard': No such file or directory

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
---
 meta/recipes-kernel/modutils-initscripts/files/modutils.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
index 28fe6f92d77f..67e1dcd9907e 100755
--- a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
+++ b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
@@ -13,6 +13,7 @@
 
 LOAD_MODULE=modprobe
 [ -f /proc/modules ] || exit 0
+[ -d /lib/modules/`uname -r` ] || exit 0
 
 # Test if modules.dep exists and has a size greater than zero
 if [ ! -s /lib/modules/`uname -r`/modules.dep ]; then
-- 
2.30.2


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

* [PATCH 2/3] sysvinit-inittab/start_getty: Check /sys for the tty device existence
  2021-04-07 12:18 [PATCH 0/3] Fixes two warnings when boot with qemuppc64 Kevin Hao
  2021-04-07 12:18 ` [PATCH 1/3] modutils-initscripts: Bail out when no module is installed Kevin Hao
@ 2021-04-07 12:18 ` Kevin Hao
  2021-04-07 12:18 ` [PATCH 3/3] Revert "inittab: Add getty launch on hvc0 for qemuppc64" Kevin Hao
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Hao @ 2021-04-07 12:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie

The hvc tty driver doesn't populate a file like /proc/tty/driver/serial,
so the current implementation of start_getty doesn't work for the hvc
console. By checking the /sys/class/tty/ for the tty device existence,
it should support more console types and also make the codes more simple.

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
---
 .../sysvinit/sysvinit-inittab/start_getty     | 44 ++-----------------
 1 file changed, 3 insertions(+), 41 deletions(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
index dfa799adac2e..699a1ead1a40 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -1,17 +1,4 @@
 #!/bin/sh
-###############################################################################
-# This script is used to automatically set up the serial console(s) on startup.
-# The variable SERIAL_CONSOLES can be set in meta/conf/machine/*.conf.
-# Script enhancement has been done based on Bug YOCTO #10844.
-# Most of the information is retrieved from /proc virtual filesystem containing
-# all the runtime system information (eg. system memory, device mount, etc).
-###############################################################################
-
-# Get active serial filename.
-active_serial=$(grep "serial" /proc/tty/drivers | cut -d/ -f1 | sed "s/ *$//")
-
-# Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc).
-runtime_tty=$(echo $2 | grep -oh '[0-9]\+')
 
 # busybox' getty does this itself, util-linux' agetty needs extra help
 getty="/sbin/getty"
@@ -25,31 +12,6 @@ case $(readlink -f "${getty}") in
         ;;
 esac
 
-# Backup $IFS.
-DEFAULT_IFS=$IFS
-# Customize Internal Field Separator.
-IFS="$(printf '\n\t')"
-
-for line in $active_serial; do
-	# Check we have the file containing current active serial target index.
-	if [ -e "/proc/tty/driver/$line" ]
-        then
-		# Remove all unknown entries and discard the first line (desc).
-		activetty=$(grep -v "unknown" "/proc/tty/driver/$line" \
-			    | tail -n +2 | grep -oh "^\s*\S*[0-9]\+")
-		for active in $activetty; do
-			# If indexes do match then enable the serial console.
-			if [ $active -eq $runtime_tty ]
-			then
-				if [ -c /dev/$2 ]
-				then
-				    ${setsid:-} ${getty} -L $1 $2 $3
-				fi
-				break
-			fi
-		done
-	fi
-done
-
-# Restore $IFS.
-IFS=$DEFAULT_IFS
+if [ -e /sys/class/tty/$2 -a -c /dev/$2 ]; then
+	${setsid:-} ${getty} -L $1 $2 $3
+fi
-- 
2.30.2


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

* [PATCH 3/3] Revert "inittab: Add getty launch on hvc0 for qemuppc64"
  2021-04-07 12:18 [PATCH 0/3] Fixes two warnings when boot with qemuppc64 Kevin Hao
  2021-04-07 12:18 ` [PATCH 1/3] modutils-initscripts: Bail out when no module is installed Kevin Hao
  2021-04-07 12:18 ` [PATCH 2/3] sysvinit-inittab/start_getty: Check /sys for the tty device existence Kevin Hao
@ 2021-04-07 12:18 ` Kevin Hao
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Hao @ 2021-04-07 12:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie

This reverts commit ed69ef20167da0986bc9363d1a91e62001995af4.

The console entry has already been added into /etc/inittab based
on the SERIAL_CONSOLES. So drop this redundant entry.

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
---
 meta/recipes-core/busybox/busybox-inittab_1.33.0.bb    | 3 ---
 meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 4 ----
 2 files changed, 7 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox-inittab_1.33.0.bb b/meta/recipes-core/busybox/busybox-inittab_1.33.0.bb
index 0021e45511d7..3804f4f7b2d0 100644
--- a/meta/recipes-core/busybox/busybox-inittab_1.33.0.bb
+++ b/meta/recipes-core/busybox/busybox-inittab_1.33.0.bb
@@ -44,9 +44,6 @@ EOF
 	fi
 
 }
-do_install_append_qemuppc64 () {
-            echo "9:12345:respawn:${base_sbindir}/getty 38400 hvc0" >> ${D}${sysconfdir}/inittab
-}
 
 pkg_postinst_${PN} () {
 # run this on host and on target
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index 0af116f35cbd..d95d1a63f5c4 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -53,10 +53,6 @@ EOF
     fi
 }
 
-do_install_append_qemuppc64 () {
-            echo "9:12345:respawn:${base_sbindir}/getty 38400 hvc0" >> ${D}${sysconfdir}/inittab
-}
-
 pkg_postinst_${PN} () {
 # run this on host and on target
 if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
-- 
2.30.2


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

end of thread, other threads:[~2021-04-07 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 12:18 [PATCH 0/3] Fixes two warnings when boot with qemuppc64 Kevin Hao
2021-04-07 12:18 ` [PATCH 1/3] modutils-initscripts: Bail out when no module is installed Kevin Hao
2021-04-07 12:18 ` [PATCH 2/3] sysvinit-inittab/start_getty: Check /sys for the tty device existence Kevin Hao
2021-04-07 12:18 ` [PATCH 3/3] Revert "inittab: Add getty launch on hvc0 for qemuppc64" Kevin Hao

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.